Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if dokkurc files are readable before attempting to source #3065

Merged
merged 1 commit into from
Feb 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions dokku
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ set -eo pipefail
shopt -s nullglob

export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
[[ -f $DOKKU_ROOT/dokkurc ]] && source "$DOKKU_ROOT/dokkurc"
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source "$f"; done
if [[ -f "$DOKKU_ROOT/dokkurc" ]]; then
if [[ -r $DOKKU_ROOT/dokkurc ]]; then
source "$DOKKU_ROOT/dokkurc"
else
echo "Unable to read $DOKKU_ROOT/dokkurc for sourcing" 1>&2
exit 1
fi
fi
if [[ -d $DOKKU_ROOT/.dokkurc ]]; then
for f in $DOKKU_ROOT/.dokkurc/*; do
if [[ -r "$f" ]]; then
source "$f"
else
echo "Unable to read $f for sourcing" 1>&2
exit 1
fi
done
fi
[[ $DOKKU_TRACE ]] && set -x

export DOKKU_DISTRO
Expand Down