mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-19 22:21:45 +00:00
Use system defined target file
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
parent
b1d9a32973
commit
08676f6775
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
|
@ -15,6 +15,7 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
||||||
const tempdir = os === "windows" ? process.env.TEMP + "\\" : "/tmp/";
|
const tempdir = os === "windows" ? process.env.TEMP + "\\" : "/tmp/";
|
||||||
const binpath = os === "windows" ? "C:\\Program Files\\GoTestTools\\bin\\" : "/usr/local/bin/";
|
const binpath = os === "windows" ? "C:\\Program Files\\GoTestTools\\bin\\" : "/usr/local/bin/";
|
||||||
const extract = os === "windows" ? "tar -xvf" : "tar -xvzf";
|
const extract = os === "windows" ? "tar -xvf" : "tar -xvzf";
|
||||||
|
const binfile = os === "windows" ? "gotestfmt.exe" : "gotestfmt";
|
||||||
const archive = `${tempdir}gotestfmt${postfix}`;
|
const archive = `${tempdir}gotestfmt${postfix}`;
|
||||||
|
|
||||||
if (os === "windows") {
|
if (os === "windows") {
|
||||||
|
|
@ -40,7 +41,7 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
||||||
// Extract the archive into the install target
|
// Extract the archive into the install target
|
||||||
console.log("Unpacking archive file...")
|
console.log("Unpacking archive file...")
|
||||||
execSync(`${extract} "${archive}"`)
|
execSync(`${extract} "${archive}"`)
|
||||||
fs.rename("gotestfmt", `${binpath}/gotestfmt`, function (err) {
|
fs.rename(binfile, `${binpath}/{binfile}`, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue