Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update the save_file command in generate_dump to handle folders #28

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1082,18 +1082,24 @@ save_file() {
fi

if $do_gzip; then
gz_path="${gz_path}.gz"
tar_path="${tar_path}.gz"
if $NOOP; then
if [ ! -d "$path" ]; then
gz_path="${gz_path}.gz"
tar_path="${tar_path}.gz"

if $NOOP; then
echo "gzip -c $orig_path > $gz_path"
else
else
gzip -c $orig_path > $gz_path
fi
else
if $NOOP; then
echo "cp $orig_path $gz_path"
fi
else
cp $orig_path $gz_path
gz_path="${gz_path}.tar.gz"
tar_path="${tar_path}.tar.gz"

if $NOOP; then
echo "tar -czvf $gz_path -C $(dirname $orig_path) $(basename $orig_path)"
else
tar -czvf "$gz_path" -C "$(dirname "$orig_path")" "$(basename "$orig_path")"
fi
fi
fi

Expand Down
Loading