mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-16 20:51:46 +00:00
Attempt to create custom binpath in windows
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
parent
5e50217ad5
commit
ac4055ad14
1 changed files with 6 additions and 1 deletions
7
index.js
7
index.js
|
|
@ -13,10 +13,15 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
||||||
// Determine environment specific details, paths etc...
|
// Determine environment specific details, paths etc...
|
||||||
const postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`;
|
const postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`;
|
||||||
const tempdir = os === "windows" ? process.env.TEMP + "\\" : "/tmp/";
|
const tempdir = os === "windows" ? process.env.TEMP + "\\" : "/tmp/";
|
||||||
const binpath = os === "windows" ? process.env.USERPROFILE + "\\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 archive = `${tempdir}gotestfmt${postfix}`;
|
const archive = `${tempdir}gotestfmt${postfix}`;
|
||||||
|
|
||||||
|
if (os === "windows") {
|
||||||
|
fs.mkdirpSync(binpath)
|
||||||
|
execSync(`echo "${binpath}" >> ${process.env.GITHUB_PATH}`)
|
||||||
|
}
|
||||||
|
|
||||||
// Search through the latest release assets for an install canidate
|
// Search through the latest release assets for an install canidate
|
||||||
for (let asset of releaseAssets.data) {
|
for (let asset of releaseAssets.data) {
|
||||||
// Check if the asset name matches the determined postfix
|
// Check if the asset name matches the determined postfix
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue