Skip to content

Commit a79cf14

Browse files
authored
Fix running argbash on MacOS (#609)
argbash uses `#!/bin/bash`. On MacOS, this means the MacOS version of bash will be used. This wasn't a problem in the past, but it appears to be an issue now (maybe because of a change to one of the recent Gradle versions, or maybe because of a recent MacOS update). When MacOS bash was used, argbash would fail with a syntax error. This is because it uses bash features that are not available in the MacOS version of bash. The solution is to use /usr/bin/env bash to invoke argbash, which then uses whatever version of bash is first on the system path. For MacOS developers, this will be a more recent GNU version of bash.
1 parent f4180da commit a79cf14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

buildSrc/src/main/kotlin/ApplyArgbash.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class ApplyArgbash @Inject constructor(
5050

5151
logger.info("Applying argbash to $file")
5252
execOperations.exec {
53-
commandLine(argbash, file, "-o", outputFile)
53+
commandLine("/usr/bin/env", "bash", argbash, file, "-o", outputFile)
5454
}
5555
}
5656
}

0 commit comments

Comments
 (0)