Skip to content

Commit defb019

Browse files
committed
fix: Always use semicolon
**Problem** With sbt 2.x, the runner defaults to using sbtn, which interprets sbt foo bar as a single command. **Solution** This injects semicolon as sbt "foo; bar"
1 parent 49f6a4c commit defb019

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ jobs:
6666

6767
- name: Check that workflows are up to date
6868
shell: bash
69-
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
69+
run: sbt '++ ${{ matrix.scala }}; githubWorkflowCheck'
7070

7171
- if: matrix.java != 'zulu@8'
7272
shell: bash
73-
run: sbt '++ ${{ matrix.scala }}' '+ test' '+ scripted'
73+
run: sbt '++ ${{ matrix.scala }}; + test; + scripted'
7474

7575
- if: matrix.java == 'zulu@8'
7676
shell: bash
77-
run: sbt '++ ${{ matrix.scala }}' test scripted
77+
run: sbt '++ ${{ matrix.scala }}; test; scripted'
7878

7979
- name: Clean up Ivy Local repo
8080
shell: bash
@@ -153,4 +153,4 @@ jobs:
153153
PGP_SECRET: ${{ secrets.PGP_SECRET }}
154154
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
155155
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
156-
run: sbt ci-release
156+
run: sbt 'ci-release'

src/main/scala/sbtghactions/GenerativePlugin.scala

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,9 @@ ${indent(rendered.mkString("\n"), 1)}"""
281281
case sbtStep: Sbt =>
282282
import sbtStep.commands
283283

284-
val sbtClientMode = sbt.matches("""sbt.* --client($| .*)""")
285-
val safeCommands = if (sbtClientMode)
286-
s"'${(sbtStepPreamble ::: commands).mkString("; ")}'"
287-
else (sbtStepPreamble ::: commands).map { c =>
288-
if (c.indexOf(' ') >= 0)
289-
s"'$c'"
290-
else
291-
c
292-
}.mkString(" ")
293-
284+
val multi = s"'${(sbtStepPreamble ::: commands).mkString("; ")}'"
294285
renderRunBody(
295-
commands = List(s"$sbt $safeCommands"),
286+
commands = List(s"$sbt $multi"),
296287
params = sbtStep.params,
297288
renderedShell = renderedShell
298289
)

0 commit comments

Comments
 (0)