Skip to content

Commit

Permalink
Merge pull request #12 from dscho/fix-the-path
Browse files Browse the repository at this point in the history
Fix the PATH
  • Loading branch information
dscho authored Feb 18, 2021
2 parents 098bf8d + 6a51a40 commit 7fa1f72
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
run: |
set -x
echo "This is the MSYS2 pseudo root: $(cygpath -aw /)"
test "gcc is /mingw64/bin/gcc" = "$(type gcc)"
printf '%s\n' \
"#include <stdio.h>" \
'' \
Expand Down
17 changes: 11 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,34 @@ async function run(): Promise<void> {
useCache = false
}

let needToDownload = true
try {
if (useCache && (await restoreCache([outputDirectory], id))) {
core.info(`Cached ${id} was successfully restored`)
return
needToDownload = false
}
} catch (e) {
core.warning(`Cannot use @actions/cache (${e})`)
useCache = false
}

core.info(`Downloading ${artifactName}`)
await download(
outputDirectory,
verbose.match(/^\d+$/) ? parseInt(verbose) : verbose === 'true'
)
if (needToDownload) {
core.info(`Downloading ${artifactName}`)
await download(
outputDirectory,
verbose.match(/^\d+$/) ? parseInt(verbose) : verbose === 'true'
)

if (useCache && !(await saveCache([outputDirectory], id))) {
core.warning(`Failed to cache ${id}`)
if (useCache && !(await saveCache([outputDirectory], id))) {
core.warning(`Failed to cache ${id}`)
}
}

// Set up PATH so that Git for Windows' SDK's `bash.exe` is found
core.addPath(`${outputDirectory}/usr/bin`)
core.exportVariable(
'MSYSTEM',
architecture === 'i686' ? 'MING32' : 'MINGW64'
)
const msystem = architecture === 'i686' ? 'MING32' : 'MINGW64'
core.addPath(`${outputDirectory}/${msystem.toLocaleLowerCase()}/bin`)
core.exportVariable('MSYSTEM', msystem)
} catch (error) {
core.setFailed(error.message)
}
Expand Down

0 comments on commit 7fa1f72

Please sign in to comment.