Add --overwrite flag to tar extraction (#156)
* Add --overwrite flag to tar extraction There are times when previous actions have already extracted at least some files to the cache location. This results in subsequent cache extraction operations to emit errors such as: > /usr/bin/tar: [dest_file_path]: Cannot open: File exists This adds the --overwrite flag to the extract call to force tar to just overwrite these files rather than reporting errors. Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> * npm run lint-fix & npm run format * ignore macOS Co-authored-by: Sergey Vilgelm <sergey.vilgelm@ibm.com>
This commit is contained in:
parent
f1dee55574
commit
a12ae43dd8
7
dist/post_run/index.js
vendored
7
dist/post_run/index.js
vendored
@ -49250,7 +49250,12 @@ function installLint(versionConfig) {
|
||||
repl = /\.zip$/;
|
||||
}
|
||||
else {
|
||||
extractedDir = yield tc.extractTar(archivePath, process.env.HOME);
|
||||
// We want to always overwrite files if the local cache already has them
|
||||
const args = ["xz"];
|
||||
if (process.platform.toString() != "darwin") {
|
||||
args.push("--overwrite");
|
||||
}
|
||||
extractedDir = yield tc.extractTar(archivePath, process.env.HOME, args);
|
||||
}
|
||||
const urlParts = assetURL.split(`/`);
|
||||
const dirName = urlParts[urlParts.length - 1].replace(repl, ``);
|
||||
|
7
dist/run/index.js
vendored
7
dist/run/index.js
vendored
@ -49260,7 +49260,12 @@ function installLint(versionConfig) {
|
||||
repl = /\.zip$/;
|
||||
}
|
||||
else {
|
||||
extractedDir = yield tc.extractTar(archivePath, process.env.HOME);
|
||||
// We want to always overwrite files if the local cache already has them
|
||||
const args = ["xz"];
|
||||
if (process.platform.toString() != "darwin") {
|
||||
args.push("--overwrite");
|
||||
}
|
||||
extractedDir = yield tc.extractTar(archivePath, process.env.HOME, args);
|
||||
}
|
||||
const urlParts = assetURL.split(`/`);
|
||||
const dirName = urlParts[urlParts.length - 1].replace(repl, ``);
|
||||
|
@ -45,7 +45,12 @@ export async function installLint(versionConfig: VersionConfig): Promise<string>
|
||||
extractedDir = await tc.extractZip(archivePath, process.env.HOME)
|
||||
repl = /\.zip$/
|
||||
} else {
|
||||
extractedDir = await tc.extractTar(archivePath, process.env.HOME)
|
||||
// We want to always overwrite files if the local cache already has them
|
||||
const args = ["xz"]
|
||||
if (process.platform.toString() != "darwin") {
|
||||
args.push("--overwrite")
|
||||
}
|
||||
extractedDir = await tc.extractTar(archivePath, process.env.HOME, args)
|
||||
}
|
||||
|
||||
const urlParts = assetURL.split(`/`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user