diff --git a/src/commands/fix_path.ts b/src/commands/fix_path.ts new file mode 100644 index 0000000..cb91f7e --- /dev/null +++ b/src/commands/fix_path.ts @@ -0,0 +1,3 @@ +import * as path from "../lib/path"; +let p = path.normalize('c:\\myFolder\\otherFolder\\IamHere.exe') +fl.trace(p) \ No newline at end of file diff --git a/src/lib/path.ts b/src/lib/path.ts index 0d20725..9508e8f 100644 --- a/src/lib/path.ts +++ b/src/lib/path.ts @@ -23,8 +23,10 @@ export function normalize(path: string): string { - path = path.replace("\\", "/"); - while (path.search("//") >= 0) { + while (path.indexOf("\\") >= 0) { + path = path.replace("\\", "/"); + } + while (path.indexOf("//") >= 0) { path = path.replace("//", "/"); } while (path.endsWith("/")) {