Keep package targets explicit and reject existing archive symlinks
This commit is contained in:
+2
-2
@@ -16,12 +16,12 @@ elif [[ $# != 0 ]]; then
|
||||
fi
|
||||
[[ $destination == /* ]] || { printf 'Output directory must be absolute.\n' >&2; exit 2; }
|
||||
for output in "$destination" "$destination.tar.gz" "$destination.tar.gz.sha256"; do
|
||||
[[ ! -e $output ]] || { printf 'Refusing to replace %s\n' "$output" >&2; exit 1; }
|
||||
[[ ! -e $output && ! -L $output ]] || { printf 'Refusing to replace %s\n' "$output" >&2; exit 1; }
|
||||
done
|
||||
|
||||
target_dir=${CARGO_TARGET_DIR:-"$repo_root/target"}
|
||||
[[ $target_dir == /* ]] || target_dir="$repo_root/$target_dir"
|
||||
cargo build --locked --release --target "$target"
|
||||
cargo build --locked --release --target "$target" --target-dir "$target_dir"
|
||||
binary="$target_dir/$target/release/sized"
|
||||
mkdir -p "$destination"
|
||||
install -m 755 "$binary" "$destination/sized"
|
||||
|
||||
Reference in New Issue
Block a user