Skip to content

Commit 2ac7063

Browse files
authored
fix: use posix pathing to build last run file paths [CSR-3199] (#292)
* fix: use posix pathing to build last run file paths * fix: path patterns
1 parent e1467fe commit 2ac7063

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • packages/cmd/src/services/cache

packages/cmd/src/services/cache/path.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const getLastRunFilePaths = async (outputPath?: string) => {
66
const prefix = path.resolve(outputPath ?? './test-results');
77

88
const patterns = [
9-
path.resolve(prefix, '**/.last-run.json'),
10-
path.resolve(prefix, '.last-run.json'),
9+
path.posix.join(prefix.replace(/\\/g, '/'), '**/.last-run.json'),
10+
path.posix.join(prefix.replace(/\\/g, '/'), '.last-run.json'),
1111
];
1212

1313
return globby.sync(patterns);
@@ -19,7 +19,9 @@ export const getUploadPaths = async (pathPatterns: string[] = []) => {
1919
const uploadPaths: string[] = [];
2020

2121
if (filteredPaths.length > 0) {
22-
uploadPaths.push(...globby.sync(pathPatterns));
22+
uploadPaths.push(
23+
...globby.sync(pathPatterns.map((p) => p.replace(/\\/g, '/')))
24+
);
2325
}
2426
return uploadPaths;
2527
};

0 commit comments

Comments
 (0)