File tree Expand file tree Collapse file tree 1 file changed +22
-22
lines changed
share/github-backup-utils Expand file tree Collapse file tree 1 file changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,28 @@ YELLOW='\033[0;33m'
21
21
BLUE=' \033[0;34m'
22
22
NC=' \033[0m' # No Colo# Logging display and formatting functions
23
23
24
+ # If we don't have a readlink command, parse ls -l output.
25
+ if ! type readlink 1> /dev/null 2>&1 ; then
26
+ readlink () {
27
+ local ret=0 f=' '
28
+ while [ $# -gt 0 ]; do
29
+ f=" $1 "
30
+ shift 1
31
+
32
+ [ ! -e " $f " ] && [ ! -h " $f " ] && {
33
+ ret=1
34
+ continue
35
+ }
36
+
37
+ # shellcheck disable=SC2012 # In this specific scenario, this method is OK
38
+ f=" $( ls -ld " $f " ) "
39
+ echo " ${f//* -> / } "
40
+ done
41
+
42
+ return $ret
43
+ }
44
+ fi
45
+
24
46
# Log a message to stdout
25
47
log_level () {
26
48
local level=$1
@@ -402,28 +424,6 @@ ghe_remote_version_config() {
402
424
# ##############################################################################
403
425
# ## Utility functions
404
426
405
- # If we don't have a readlink command, parse ls -l output.
406
- if ! type readlink 1> /dev/null 2>&1 ; then
407
- readlink () {
408
- local ret=0 f=' '
409
- while [ $# -gt 0 ]; do
410
- f=" $1 "
411
- shift 1
412
-
413
- [ ! -e " $f " ] && [ ! -h " $f " ] && {
414
- ret=1
415
- continue
416
- }
417
-
418
- # shellcheck disable=SC2012 # In this specific scenario, this method is OK
419
- f=" $( ls -ld " $f " ) "
420
- echo " ${f//* -> / } "
421
- done
422
-
423
- return $ret
424
- }
425
- fi
426
-
427
427
# Run ghe-host-check and establish the version of the remote GitHub instance in
428
428
# the exported GHE_REMOTE_VERSION variable. If the remote version has already
429
429
# been established then don't perform the host check again. Utilities in share/github-backup-utils
You can’t perform that action at this time.
0 commit comments