Skip to content

Commit 7a7b520

Browse files
committed
Fix cs bin directory on the M1 runner
1 parent cfdfd8a commit 7a7b520

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
- run: echo 'name := "foo"' > build.sbt
3232
- id: scala-cli-setup
3333
uses: ./
34+
env:
35+
COURSIER_BIN_DIR: ${{ github.workspace }}/cs/bin
3436
with:
3537
jvm: ${{ matrix.jvm }}
3638
apps: sbt sbtn ammonite bloop:1.4.11

src/main.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,15 @@ async function run(): Promise<void> {
139139
}
140140
apps.push(`scala-cli${version ? `:${version}` : ''}`)
141141
if (value && apps.length) {
142-
const coursierBinDir = path.join(os.homedir(), 'cs', 'bin')
143-
core.exportVariable('COURSIER_BIN_DIR', coursierBinDir)
144-
core.addPath(coursierBinDir)
142+
if (process.env.COURSIER_BIN_DIR) {
143+
core.addPath(process.env.COURSIER_BIN_DIR)
144+
} else {
145+
const coursierBinDir = path.join(os.homedir(), 'cs', 'bin')
146+
core.exportVariable('COURSIER_BIN_DIR', coursierBinDir)
147+
core.addPath(coursierBinDir)
148+
}
149+
// eslint-disable-next-line no-console
150+
console.log('COURSIER_BIN_DIR', process.env.COURSIER_BIN_DIR)
145151
await cs('install', '--contrib', ...apps)
146152
core.setOutput(
147153
'scala-cli-version',

0 commit comments

Comments
 (0)