Skip to content

Commit

Permalink
tool/bundle-artifacts: ensure the specified output directory exists b…
Browse files Browse the repository at this point in the history
…efore moving things into it
  • Loading branch information
Will committed May 26, 2024
1 parent 3dc415c commit fc1d794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tool/bundle-artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}

out_dir=$1
out_dir=$(dirname "$out_dir")/$(basename "$out_dir")
platform_name=$2
tmp_artifacts_dir=$(mktemp -d) || exit 1
tmp_tar_dir=$(mktemp -d) || exit 1
Expand All @@ -21,6 +20,7 @@ tmp_tar_file=$tmp_tar_dir/$(basename "$out_dir").tar.gz
do cp -r "$p" "$tmp_artifacts_dir" || exit 1
done
[ -d "$out_dir" ] && rm -rf "$out_dir"
(cd "$tmp_artifacts_dir" && tar -czf "$tmp_tar_file" . || exit 1) && mv "$tmp_tar_file" "$out_dir.tar.gz" && echo "$out_dir.tar.gz"
[ ! -d "$(dirname "$out_dir")" ] && mkdir -p "$(dirname "$out_dir")"
cp -r "$tmp_artifacts_dir" "$out_dir" && echo "$out_dir"
(cd "$tmp_artifacts_dir" && tar -czf "$tmp_tar_file" . || exit 1) && mv "$tmp_tar_file" "$out_dir.tar.gz" && echo "$out_dir.tar.gz"

0 comments on commit fc1d794

Please sign in to comment.