Permalink
Browse files

fix(service-worker): use posix path resolution for generation of ngsw…

….json (#19527)

PR Close #19527
  • Loading branch information...
Delagen authored and tbosch committed Oct 10, 2017
1 parent 64b3619 commit 621f87b2bde074d5317689f544f90714876dbbdc
Showing with 6 additions and 5 deletions.
  1. +6 −5 packages/service-worker/cli/filesystem.ts
@@ -21,12 +21,13 @@ export class NodeFilesystem implements Filesystem {
const entries = fs.readdirSync(dir).map(
(entry: string) => ({entry, stats: fs.statSync(path.join(dir, entry))}));
const files = entries.filter((entry: any) => !entry.stats.isDirectory())
.map((entry: any) => path.join(_path, entry.entry));
.map((entry: any) => path.posix.join(_path, entry.entry));
return entries.filter((entry: any) => entry.stats.isDirectory())
.map((entry: any) => path.join(_path, entry.entry))
.map((entry: any) => path.posix.join(_path, entry.entry))
.reduce(
async(list: string[], subdir: string) => (await list).concat(await this.list(subdir)),
async(list: Promise<string[]>, subdir: string) =>
(await list).concat(await this.list(subdir)),
Promise.resolve(files));
}
@@ -46,5 +47,5 @@ export class NodeFilesystem implements Filesystem {
fs.writeFileSync(file, contents);
}
private canonical(_path: string): string { return path.join(this.base, _path); }
}
private canonical(_path: string): string { return path.posix.join(this.base, _path); }
}

0 comments on commit 621f87b

Please sign in to comment.