Skip to content

Commit 0f06c0a

Browse files
authored
Change shebang for groovy
#!/usr/bin/env groovy is more general and searches the right executable for groovy for you on many systems. This makes the Jenkinsfile more compatible with different systems.
1 parent 20a37eb commit 0f06c0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/BEST_PRACTICES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is a collection of tips, advice, gotchas and other best practices for using
1616
# `Jenkinsfile`s and Multibranch
1717
* Use `checkout scm` to automatically checkout current revision of branch
1818
* Use `$env.BRANCH_NAME` variable if you have logical difference in your flow between branches, i.e. to distinguish different behavior for production-ready branches versus sandbox or pull request branches.
19-
* For `Jenkinsfile`s, make sure to put `#!groovy` at the top of the file so that IDEs, GitHub diffs, etc properly detect the language and do syntax highlighting for you.
19+
* For `Jenkinsfile`s, make sure to put `#!/usr/bin/env groovy` at the top of the file so that IDEs, GitHub diffs, etc properly detect the language and do syntax highlighting for you.
2020
* But note that this doesn't mean you can run "groovy Jenkinsfile" or "./Jenkinsfile" - Pipeline doesn't run standalone! This is just a trick to help in your IDE, etc.
2121

2222
# Groovy gotchas

0 commit comments

Comments
 (0)