1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Merge pull request #279 from sargunster/shebang

Always generate the shebang line
This commit is contained in:
Cedric Beust 2016-07-12 20:10:07 -07:00 committed by GitHub
commit e6efdc2f75

View file

@ -268,8 +268,7 @@ public class Main {
private void generateKobaltW(Path filePath) throws IOException {
//
// For kobaltw: try to generate it with the correct env shebang. If this fails,
// we'll generate it without the env shebang
// For kobaltw: try to generate it with the correct env shebang.
//
File envFile = new File("/bin/env");
if (!envFile.exists()) {
@ -278,10 +277,9 @@ public class Main {
String content = "";
if (envFile.exists()) {
content = "#!" + envFile.getAbsolutePath() + " bash\n";
}
log(2, " Generating " + KOBALTW + (envFile.exists() ? " with shebang" : "") + ".");
content = "#!" + envFile.getAbsolutePath() + " bash\n";
log(2, " Generating " + KOBALTW + " with shebang.");
content += "java -jar $(dirname $0)/kobalt/wrapper/kobalt-wrapper.jar $*\n";
@ -473,4 +471,4 @@ public class Main {
return process.waitFor();
}
}
}