Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion share/github-backup-utils/ghe-backup-config
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GHE_HOSTNAME_PRESERVE="$GHE_HOSTNAME"
# Source in the backup config file from the local working copy location first
# and then falling back to the system location.
config_found=false
for f in "$GHE_BACKUP_CONFIG" "/etc/github-backup-utils/backup.config"; do
for f in "$GHE_BACKUP_CONFIG" "$HOME/github-backup-utils/backup.config" "/etc/github-backup-utils/backup.config"; do
Copy link
Contributor

@tjl2 tjl2 Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, it'd be fairly standard behaviour for a config file in a user's home directory to override the settings in a system config file. Given that, would it be an idea to switch the order of the $HOME/github-backup-utils/backup.config and /etc/github-backup-utils/backup.config files in this loop?

EDIT: I hadn't seen the break that follows, later in the code 😊

if [ -f "$f" ]; then
GHE_BACKUP_CONFIG="$f"
. "$GHE_BACKUP_CONFIG"
Expand All @@ -59,6 +59,7 @@ done
if ! $config_found; then
echo "Error: No backup configuration file found. Tried:" 1>&2
echo " - $GHE_BACKUP_CONFIG" 1>&2
echo " - $HOME/github-backup-utils/backup.config" 1>&2
echo " - /etc/github-backup-utils/backup.config" 1>&2
exit 2
fi
Expand Down