Skip to content

Commit

Permalink
Fix exposed INSTALL_DIR_FOR_${toolName} variables
Browse files Browse the repository at this point in the history
We're missing the /bin
  • Loading branch information
paulo-ferraz-oliveira committed Jan 28, 2024
1 parent a145f88 commit a496e8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10723,8 +10723,10 @@ async function install(toolName, opts) {
postExtract: async (cachePath) => {
const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir)
fs.chmodSync(oldPath, 0o755)
fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)

const ps1Filename = path.join(bindir, 'rebar3.ps1')
fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`)
Expand Down Expand Up @@ -10776,11 +10778,12 @@ async function installTool(opts) {
await platformOpts.postExtract(cachePath)

core.debug(`Adding ${cachePath}'s bin to system path`)
core.addPath(path.join(cachePath, 'bin'))
const catchPathBin = path.join(cachePath, 'bin')
core.addPath(catchPathBin)

const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
core.debug(`Exporting ${installDirForVarName} as ${cachePath}`)
core.exportVariable(installDirForVarName, cachePath)
core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
core.exportVariable(installDirForVarName, catchPathBin)

core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion()
Expand Down
11 changes: 7 additions & 4 deletions src/setup-beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,10 @@ async function install(toolName, opts) {
postExtract: async (cachePath) => {
const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir)
fs.chmodSync(oldPath, 0o755)
fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)

const ps1Filename = path.join(bindir, 'rebar3.ps1')
fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`)
Expand Down Expand Up @@ -956,11 +958,12 @@ async function installTool(opts) {
await platformOpts.postExtract(cachePath)

core.debug(`Adding ${cachePath}'s bin to system path`)
core.addPath(path.join(cachePath, 'bin'))
const catchPathBin = path.join(cachePath, 'bin')
core.addPath(catchPathBin)

const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
core.debug(`Exporting ${installDirForVarName} as ${cachePath}`)
core.exportVariable(installDirForVarName, cachePath)
core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
core.exportVariable(installDirForVarName, catchPathBin)

core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion()
Expand Down

0 comments on commit a496e8e

Please sign in to comment.