mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-17 07:58:27 +00:00
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>
This commit is contained in:
parent
125ac487c1
commit
f0b40ec80f
3 changed files with 9 additions and 3 deletions
4
dist/post_run/index.js
vendored
4
dist/post_run/index.js
vendored
|
|
@ -48580,7 +48580,9 @@ 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
|
||||
let args = ['xz', '--overwrite'];
|
||||
extractedDir = yield tc.extractTar(archivePath, process.env.HOME, args);
|
||||
}
|
||||
const urlParts = assetURL.split(`/`);
|
||||
const dirName = urlParts[urlParts.length - 1].replace(repl, ``);
|
||||
|
|
|
|||
4
dist/run/index.js
vendored
4
dist/run/index.js
vendored
|
|
@ -48590,7 +48590,9 @@ 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
|
||||
let args = ['xz', '--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,9 @@ 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
|
||||
let args = ['xz', '--overwrite']
|
||||
extractedDir = await tc.extractTar(archivePath, process.env.HOME, args)
|
||||
}
|
||||
|
||||
const urlParts = assetURL.split(`/`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue