Skip to content

Commit

Permalink
import now checks if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
BretFisher committed Oct 25, 2024
1 parent d129222 commit d6b0c71
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vackup
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ cmd_import() {
docker volume create "$VOLUME_NAME"
fi

# TODO: check if file exists on host, if it does
# create a option for overwrite and check if that's set
if [ ! -r "$FILE_NAME" ]; then
echo "Error: Could not find or open tar file $FILE_NAME"
exit 1
fi

if [ -d "$FILE_NAME" ]; then
echo "Error: $FILE_NAME is a directory"
exit 1
fi

# TODO: if FILE_NAME starts with / we need to error out
# unless we can translate full file paths

Expand Down

0 comments on commit d6b0c71

Please sign in to comment.