Skip to content

Commit

Permalink
make it work on macos by not use readline and ;& fallthrough for Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
veto8 committed Jan 11, 2025
1 parent 2a8a731 commit e0480f8
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions vackup
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,21 @@ error() {
fulldirname() {
DIRECTORY=$(dirname "$1")

case "$DIRECTORY" in
/*) ;;
.*) ;& # fallthrough
*) DIRECTORY="$(pwd)/$DIRECTORY" ;;
esac
DIRECTORY=$(readlink -m "$DIRECTORY")
if ! [ "$(uname)" == "Darwin" ]; then
case "$DIRECTORY" in
/*) ;;
.*) ;& # fallthrough
*) DIRECTORY="$(pwd)/$DIRECTORY" ;;
esac
DIRECTORY=$(readlink -m "$DIRECTORY")
else
case "$DIRECTORY" in
/*) ;;
.*) ;; # fallthrough
*) DIRECTORY="$(pwd)/$DIRECTORY" ;;
esac
DIRECTORY="$(pwd)/$DIRECTORY"
fi

echo "$DIRECTORY"
}
Expand Down Expand Up @@ -221,6 +230,17 @@ cmd_load() {
echo "Successfully copied /volume-data from $IMAGE_NAME into volume $VOLUME_NAME"
}

unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
MSYS_NT*) machine=MSys;;
*) machine="UNKNOWN:${unameOut}"
esac


COMMAND="$1"
case "$COMMAND" in
export) cmd_export "$@" ;;
Expand Down

0 comments on commit e0480f8

Please sign in to comment.