Skip to content

Commit

Permalink
Add a bit of coding standard for how to avoid the issue we saw in the…
Browse files Browse the repository at this point in the history
… init shellscript for starting prime yesterday. (#226)
  • Loading branch information
la3lma authored Aug 24, 2018
1 parent d9c3a0c commit aa9d8fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ by the github repository. It should all be open.
* [Greg's wiki about shell scripting is a very good resource](http://mywiki.wooledge.org/)
* For complex output (multiple lines etc.), consider using "printf"
instead of the simple "echo".
* Scripts, in particular scripts that are run during startup of containers
either for production or testing, should die cleanly and visibly as soon as
possible if they have to. For instance, if the script depends on
an executable that may be missing, the script should test for the
existance of the executable before any of the script's "payload" is
executed. Example:

DEPENDENCIES="foo bar baz gazonk"
for dep in $DEPENDENCIES; do
if [[ -z "$(type $dep)" ]] ; then
echo "Cannot locate executable '${dep}', bailing out"
exit 1
fi
done

## Kotlin

Expand Down

0 comments on commit aa9d8fd

Please sign in to comment.