Skip to content

Instantly share code, notes, and snippets.

@robskidmore
Created December 3, 2014 22:08
Show Gist options
  • Save robskidmore/4920b7d8751dbcfb05c4 to your computer and use it in GitHub Desktop.
Save robskidmore/4920b7d8751dbcfb05c4 to your computer and use it in GitHub Desktop.
bash-test-if-exists
exists () {
if [[ -f $1 ]]
then
. $1
echo "${blue}$msgSuccess$reset $1 included"
else
echo "${red}$msgError$reset: Could not locate $1."
exit 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment