Skip to content

Commit e12e48e

Browse files
committed
feature: longer timeout for Github Actions
cleanup: small changes and improvements
1 parent 50cd733 commit e12e48e

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
# macos-10.15
1818
- windows-2022
1919
runs-on: ${{ matrix.os }}
20+
timeout-minutes: 30
2021
# defaults:
2122
# run:
2223
# shell: bash
@@ -105,6 +106,7 @@ jobs:
105106
echo "${PWD}" >> $GITHUB_PATH
106107
107108
- name: Run tests
109+
timeout-minutes: 10
108110
shell: bash
109111
if: ${{ runner.os != 'Windows' }}
110112
run: |

src/main/kotlin/kscript/app/KscriptHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import kscript.app.parser.Parser
99
import kscript.app.resolver.*
1010
import kscript.app.util.Executor
1111
import kscript.app.util.Logger
12+
import kscript.app.util.Logger.devMsg
1213
import kscript.app.util.Logger.infoMsg
1314
import org.docopt.DocOptWrapper
1415
import java.net.URI
@@ -20,6 +21,9 @@ class KscriptHandler(private val config: Config, private val docopt: DocOptWrapp
2021
Logger.silentMode = docopt.getBoolean("silent")
2122
Logger.devMode = docopt.getBoolean("development")
2223

24+
devMsg("KScript configuration:")
25+
devMsg(config.toString())
26+
2327
// create kscript dir if it does not yet exist
2428
val appDir = AppDir(config.kscriptDir)
2529

src/main/kotlin/kscript/app/code/Templates.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object Templates {
114114
--add-bootstrap-header Prepend bash header that installs kscript if necessary
115115
116116
117-
Copyright : 2021 Holger Brandl
117+
Copyright : 2022 Holger Brandl
118118
License : MIT
119119
Version : v${version}
120120
Website : https://github.com/holgerbrandl/kscript

src/main/kotlin/kscript/app/model/Config.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ data class Config(
1717
val repositoryUserEnvVariable: String,
1818
val repositoryPasswordEnvVariable: String,
1919
) {
20-
21-
2220
companion object {
2321
fun builder() = ConfigBuilder()
2422
}

src/main/kotlin/kscript/app/resolver/CommandResolver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CommandResolver(private val config: Config, private val script: Script) {
3636

3737
val classpath = resolveClasspath(dependenciesSet)
3838

39-
val kotlin = if (config.kotlinHome != null) (config.kotlinHome / "bin" / "kotlin").toString() else "kotlin"
39+
val kotlin = if (config.kotlinHome != null) (config.kotlinHome / "bin" / "kotlin").absolutePathString() else "kotlin"
4040

4141
return "$kotlin $kotlinOptsStr $classpath ${jarArtifact.execClassName} $userArgsStr"
4242
}
@@ -46,7 +46,7 @@ class CommandResolver(private val config: Config, private val script: Script) {
4646
val kotlinOptsStr = resolveKotlinOpts(script.kotlinOpts)
4747
val classpath = resolveClasspath(dependencies)
4848

49-
val kotlinc = if (config.kotlinHome != null) (config.kotlinHome / "bin" / "kotlinc").toString() else "kotlinc"
49+
val kotlinc = if (config.kotlinHome != null) (config.kotlinHome / "bin" / "kotlinc").absolutePathString() else "kotlinc"
5050

5151
return "$kotlinc $compilerOptsStr $kotlinOptsStr $classpath"
5252
}

src/main/kotlin/kscript/app/util/ShellUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object ShellUtils {
1010

1111
fun isInPath(tool: String) = evalBash("which $tool").stdout.trim().isNotBlank()
1212

13-
/** see discussion on https://github.com/holgerbrandl/kscript/issues/15*/
13+
// see discussion on https://github.com/holgerbrandl/kscript/issues/15
1414
fun guessKotlinHome(): String? {
1515
val kotlinHome = evalBash("KOTLIN_RUNNER=1 JAVACMD=echo kotlinc").stdout.run {
1616
"kotlin.home=([^\\s]*)".toRegex().find(this)?.groups?.get(1)?.value

0 commit comments

Comments
 (0)