Skip to content

Commit 390d493

Browse files
committed
Removing readlink as it doesn't work and we require Ubuntu now
1 parent 6d17c01 commit 390d493

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

share/github-backup-utils/ghe-backup-config

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ for f in "$GHE_BACKUP_CONFIG" "$GHE_BACKUP_ROOT/backup.config" \
143143
fi
144144
done
145145

146+
# If we don't have a readlink command, error out
147+
[ ! type readlink 1>/dev/null 2>&1 ] && {
148+
echo "Error: readlink not found. Please install readlink and ensure it is in your PATH." 1>&2
149+
exit 1
150+
}
151+
146152
GHE_RESTORE_IN_PROGRESS=$(readlink -fm "${GHE_DATA_DIR}/in-progress-restore")
147153
GHE_BACKUP_IN_PROGRESS=$(readlink -fm "${GHE_DATA_DIR}/in-progress-backup")
148154

@@ -401,17 +407,6 @@ ghe_remote_version_config() {
401407
###############################################################################
402408
### Utility functions
403409

404-
# If we don't have a readlink command, parse ls -l output.
405-
if ! type readlink 1>/dev/null 2>&1; then
406-
readlink() {
407-
if [ -x "$1" ]; then
408-
ls -ld "$1" | sed 's/.*-> //'
409-
else
410-
return 1
411-
fi
412-
}
413-
fi
414-
415410
# Run ghe-host-check and establish the version of the remote GitHub instance in
416411
# the exported GHE_REMOTE_VERSION variable. If the remote version has already
417412
# been established then don't perform the host check again. Utilities in share/github-backup-utils

0 commit comments

Comments
 (0)