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:
parent
08438313d5
commit
52046d1409
4 changed files with 17 additions and 21 deletions
|
@ -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
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue