Skip to content

Commit

Permalink
Merge pull request #1096 from github/hostname-fix
Browse files Browse the repository at this point in the history
Merge private to public with Hostname fix
  • Loading branch information
bonsohi authored Aug 10, 2023
2 parents 63438af + 7d19f10 commit ff83a62
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions share/github-backup-utils/ghe-backup-config
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -n "$GHE_SHOW_VERSION" ]; then
fi

# Check for "--help|-h" in args or GHE_SHOW_HELP=true and show usage
# shellcheck disable=SC2120 # the script name is always referenced
# shellcheck disable=SC2120 # Our arguments are optional and not meant to be the owning script's
print_usage() {
grep '^#/' <"$0" | cut -c 4-
exit "${1:-1}"
Expand All @@ -51,10 +51,6 @@ else
done
fi

# Add the bin and share/github-backup-utils dirs to PATH
PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
# shellcheck source=share/github-backup-utils/bm.sh
. "$GHE_BACKUP_ROOT/share/github-backup-utils/bm.sh"
# Save off GHE_HOSTNAME from the environment since we want it to override the
# backup.config value when set.
GHE_HOSTNAME_PRESERVE="$GHE_HOSTNAME"
Expand Down Expand Up @@ -150,35 +146,6 @@ log_ssh(){
log_level "ssh" "$1"
}

# Assume this script lives in share/github-backup-utils/ when setting the root
GHE_BACKUP_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"

# Get the version from the version file.
BACKUP_UTILS_VERSION="$(cat "$GHE_BACKUP_ROOT/share/github-backup-utils/version")"

# If a version check was requested, show the current version and exit
if [ -n "$GHE_SHOW_VERSION" ]; then
echo "GitHub backup-utils v$BACKUP_UTILS_VERSION"
exit 0
fi

# Check for "--help|-h" in args or GHE_SHOW_HELP=true and show usage
# shellcheck disable=SC2120 # Our arguments are optional and not meant to be the owning script's
print_usage() {
grep '^#/' <"$0" | cut -c 4-
exit "${1:-1}"
}

if [ -n "$GHE_SHOW_HELP" ]; then
print_usage
else
for a in "$@"; do
if [ "$a" = "--help" ] || [ "$a" = "-h" ]; then
print_usage
fi
done
fi

# Add the bin and share/github-backup-utils dirs to PATH
PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
# shellcheck source=share/github-backup-utils/bm.sh
Expand All @@ -187,9 +154,6 @@ PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
. "$GHE_BACKUP_ROOT/share/github-backup-utils/ghe-incremental-backup-restore"
# shellcheck source=share/github-backup-utils/track-progress
. "$GHE_BACKUP_ROOT/share/github-backup-utils/track-progress"
# Save off GHE_HOSTNAME from the environment since we want it to override the
# backup.config value when set.
GHE_HOSTNAME_PRESERVE="$GHE_HOSTNAME"


ghe_restore_check() {
Expand Down

0 comments on commit ff83a62

Please sign in to comment.