3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-22 11:25:31 +00:00

Use path.sep in path replace

This commit is contained in:
Aiqiao Yan 2020-04-13 12:20:27 -04:00
parent 08438313d5
commit 52046d1409
4 changed files with 17 additions and 21 deletions

View file

@ -56,10 +56,10 @@ export async function extractTar(archivePath: string): Promise<void> {
const args = [
"-xz",
"-f",
archivePath?.replace(/\\/g, "/"),
archivePath.replace(new RegExp("\\" + path.sep, "g"), "/"),
"-P",
"-C",
workingDirectory?.replace(/\\/g, "/")
workingDirectory.replace(new RegExp("\\" + path.sep, "g"), "/")
];
await execTar(args);
}
@ -79,10 +79,10 @@ export async function createTar(
const args = [
"-cz",
"-f",
CacheFilename?.replace(/\\/g, "/"),
CacheFilename.replace(new RegExp("\\" + path.sep, "g"), "/"),
"-P",
"-C",
workingDirectory?.replace(/\\/g, "/"),
workingDirectory.replace(new RegExp("\\" + path.sep, "g"), "/"),
"--files-from",
manifestFilename
];