Skip to content

Commit

Permalink
Fix "Windows workflow broken since recent commit" (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira authored Jan 28, 2024
1 parent 4a641b1 commit cf854bf
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 213 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ jobs:
gleam-version: ${{matrix.combo.gleam-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- run: env
- name: List environment variables
- name: Check environment variables
run: |
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}"
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}"
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}"
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}"
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
${INSTALL_DIR_FOR_GLEAM}/gleam --version
${INSTALL_DIR_FOR_OTP}/erl -version
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
10 changes: 5 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ jobs:
gleam-version: ${{matrix.combo.gleam-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- run: env
- name: List environment variables
- name: Check environment variables
run: |
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}"
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}"
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}"
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}"
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
${INSTALL_DIR_FOR_GLEAM}/gleam --version
${INSTALL_DIR_FOR_OTP}/erl -version
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
shell: bash
62 changes: 0 additions & 62 deletions dist/.github/elixir-matchers.json

This file was deleted.

15 changes: 9 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10723,16 +10723,18 @@ 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}`)
fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`)

const cmdFilename = path.join(bindir, 'rebar3.cmd')
fs.writeFileSync(
cmdFilename,
`@echo off\r\nescript.exe ${oldPath} %*`,
`@echo off\r\nescript.exe ${newPath} %*`,
)
},
reportVersion: () => {
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
37 changes: 0 additions & 37 deletions dist/install-gleam.ps1

This file was deleted.

35 changes: 0 additions & 35 deletions dist/install-gleam.sh

This file was deleted.

32 changes: 0 additions & 32 deletions dist/install-rebar3.ps1

This file was deleted.

25 changes: 0 additions & 25 deletions dist/install-rebar3.sh

This file was deleted.

15 changes: 9 additions & 6 deletions src/setup-beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,16 +903,18 @@ 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}`)
fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`)

const cmdFilename = path.join(bindir, 'rebar3.cmd')
fs.writeFileSync(
cmdFilename,
`@echo off\r\nescript.exe ${oldPath} %*`,
`@echo off\r\nescript.exe ${newPath} %*`,
)
},
reportVersion: () => {
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 cf854bf

Please sign in to comment.