mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 00:40:21 +00:00
refactor: dedupe path lowercase helpers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { lowercasePreservingWhitespace } from "openclaw/plugin-sdk/text-runtime";
|
||||
|
||||
export async function pathExists(filePath: string): Promise<boolean> {
|
||||
try {
|
||||
@@ -12,5 +13,7 @@ export async function pathExists(filePath: string): Promise<boolean> {
|
||||
|
||||
export async function resolveArtifactKey(absolutePath: string): Promise<string> {
|
||||
const canonicalPath = await fs.realpath(absolutePath).catch(() => path.resolve(absolutePath));
|
||||
return process.platform === "win32" ? canonicalPath.toLowerCase() : canonicalPath;
|
||||
return process.platform === "win32"
|
||||
? lowercasePreservingWhitespace(canonicalPath)
|
||||
: canonicalPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user