@@ -35,7 +35,7 @@ if [ -n "$GHE_SHOW_VERSION" ]; then
35
35
fi
36
36
37
37
# Check for "--help|-h" in args or GHE_SHOW_HELP=true and show usage
38
- # shellcheck disable=SC2120 # the script name is always referenced
38
+ # shellcheck disable=SC2120 # Our arguments are optional and not meant to be the owning script's
39
39
print_usage () {
40
40
grep ' ^#/' < " $0 " | cut -c 4-
41
41
exit " ${1:- 1} "
51
51
done
52
52
fi
53
53
54
- # Add the bin and share/github-backup-utils dirs to PATH
55
- PATH=" $GHE_BACKUP_ROOT /bin:$GHE_BACKUP_ROOT /share/github-backup-utils:$PATH "
56
- # shellcheck source=share/github-backup-utils/bm.sh
57
- . " $GHE_BACKUP_ROOT /share/github-backup-utils/bm.sh"
58
54
# Save off GHE_HOSTNAME from the environment since we want it to override the
59
55
# backup.config value when set.
60
56
GHE_HOSTNAME_PRESERVE=" $GHE_HOSTNAME "
@@ -150,35 +146,6 @@ log_ssh(){
150
146
log_level " ssh" " $1 "
151
147
}
152
148
153
- # Assume this script lives in share/github-backup-utils/ when setting the root
154
- GHE_BACKUP_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.." && pwd) "
155
-
156
- # Get the version from the version file.
157
- BACKUP_UTILS_VERSION=" $( cat " $GHE_BACKUP_ROOT /share/github-backup-utils/version" ) "
158
-
159
- # If a version check was requested, show the current version and exit
160
- if [ -n " $GHE_SHOW_VERSION " ]; then
161
- echo " GitHub backup-utils v$BACKUP_UTILS_VERSION "
162
- exit 0
163
- fi
164
-
165
- # Check for "--help|-h" in args or GHE_SHOW_HELP=true and show usage
166
- # shellcheck disable=SC2120 # Our arguments are optional and not meant to be the owning script's
167
- print_usage () {
168
- grep ' ^#/' < " $0 " | cut -c 4-
169
- exit " ${1:- 1} "
170
- }
171
-
172
- if [ -n " $GHE_SHOW_HELP " ]; then
173
- print_usage
174
- else
175
- for a in " $@ " ; do
176
- if [ " $a " = " --help" ] || [ " $a " = " -h" ]; then
177
- print_usage
178
- fi
179
- done
180
- fi
181
-
182
149
# Add the bin and share/github-backup-utils dirs to PATH
183
150
PATH=" $GHE_BACKUP_ROOT /bin:$GHE_BACKUP_ROOT /share/github-backup-utils:$PATH "
184
151
# shellcheck source=share/github-backup-utils/bm.sh
@@ -187,9 +154,6 @@ PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
187
154
. " $GHE_BACKUP_ROOT /share/github-backup-utils/ghe-incremental-backup-restore"
188
155
# shellcheck source=share/github-backup-utils/track-progress
189
156
. " $GHE_BACKUP_ROOT /share/github-backup-utils/track-progress"
190
- # Save off GHE_HOSTNAME from the environment since we want it to override the
191
- # backup.config value when set.
192
- GHE_HOSTNAME_PRESERVE=" $GHE_HOSTNAME "
193
157
194
158
195
159
ghe_restore_check () {
0 commit comments