Last active
April 18, 2022 18:20
-
-
Save caffeinetiger/b13f1475737781ae0d747acd73c8b987 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function exit_if_command_not_installed() { | |
| local some_command_to_check=$1 | |
| if ! command -v $some_command_to_check &> /dev/null | |
| then | |
| echo "$some_command_to_check could not be found" | |
| exit | |
| fi | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ -z "${SOME_ENV_VAR_OR_SCIPT_VAR}" ]]; then | |
| echo "SOME_ENV_VAR_OR_SCIPT_VAR is not set." >&2 | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -z ${some_variable+x} ]; then | |
| some_variable="some value"; | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment