Skip to content

Commit f571052

Browse files
authored
Merge pull request #1866 from lwronski/fix-main
Run generate reference doc as non sip
2 parents 895c060 + 406c6bc commit f571052

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

build.sc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ object `generate-reference-doc` extends SbtModule with ScalaCliScalafixModule {
156156
Deps.munit
157157
)
158158
def mainClass = Some("scala.cli.doc.GenerateReferenceDoc")
159+
160+
def forkEnv = super.forkEnv() ++ Seq(
161+
"SCALA_CLI_POWER" -> "true"
162+
)
159163
}
160164

161165
object dummy extends Module {

modules/cli/src/main/scala/scala/cli/ScalaCli.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ object ScalaCli {
3535
}
3636
private val scalaCliBinaryName = "scala-cli"
3737
private var isSipScala = {
38-
val isSipScala = for {
38+
lazy val isPowerConfigDb = for {
3939
configDb <- ConfigDb.open(Directories.directories.dbPath.toNIO).toOption
4040
powerEntry <- configDb.get(Keys.power).toOption
4141
power <- powerEntry
42-
} yield !power
43-
44-
isSipScala.getOrElse(true)
42+
} yield power
43+
val isPowerEnv = Option(System.getenv("SCALA_CLI_POWER")).flatMap(_.toBooleanOption)
44+
val isPower = isPowerEnv.orElse(isPowerConfigDb).getOrElse(false)
45+
!isPower
4546
}
4647
def allowRestrictedFeatures = !isSipScala
4748
def fullRunnerName =

modules/cli/src/main/scala/scala/cli/commands/github/SecretCreateOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.cli.commands.tags
99
// format: off
1010
@HelpMessage(
1111
s"""Creates or updates a GitHub repository secret.
12-
| $progName ${HelpMessages.PowerString}github secret create --repo repo-org/repo-name SECRET_VALUE=value:secret
12+
| $progName --power github secret create --repo repo-org/repo-name SECRET_VALUE=value:secret
1313
|""".stripMargin)
1414
final case class SecretCreateOptions(
1515
@Recurse

modules/cli/src/main/scala/scala/cli/commands/publish/PublishOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import scala.cli.commands.shared.*
1313
|We recommend running the `publish setup` sub-command once prior to
1414
|running `publish` in order to set missing `using` directives for publishing.
1515
|(but this is not mandatory)
16-
| $baseRunnerName ${HelpMessages.PowerString}publish setup .
16+
| $baseRunnerName --power publish setup .
1717
|
1818
|${HelpMessages.commandConfigurations("publish")}
1919
|

modules/cli/src/main/scala/scala/cli/commands/uninstall/Uninstall.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ object Uninstall extends ScalaCommand[UninstallOptions] {
4949
)
5050
// exit bloop server
5151
logger.debug("Stopping Bloop server...")
52-
BloopExit.run(options.bloopExit, args)
52+
BloopExit.runCommand(options.bloopExit, args, options.logging.logger)
5353
// remove scala-cli launcher
5454
logger.debug(s"Removing $baseRunnerName binary...")
5555
os.remove.all(binDirPath)

0 commit comments

Comments
 (0)