OUTPUT_NAME -> OUTPUT_PATH

This commit is contained in:
Howard Wu 2022-10-22 18:32:39 +08:00
parent ac4f52ac49
commit ff4ca1921d

View File

@ -854,7 +854,7 @@ fi
if [ ! -d "$OUTPUT_DIR" ]; then if [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR"
fi fi
OUTPUT_NAME="${OUTPUT_DIR:?}/$artifact_name" OUTPUT_PATH="${OUTPUT_DIR:?}/$artifact_name"
if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name" mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name"
if [ -z "$COMPRESS_FORMAT" ]; then if [ -z "$COMPRESS_FORMAT" ]; then
@ -866,22 +866,22 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
FILE_EXT=".tar$FILE_EXT" FILE_EXT=".tar$FILE_EXT"
fi fi
fi fi
rm -f "${OUTPUT_NAME:?}$FILE_EXT" || abort rm -f "${OUTPUT_PATH:?}$FILE_EXT" || abort
if [ "$COMPRESS_FORMAT" = "7z" ]; then if [ "$COMPRESS_FORMAT" = "7z" ]; then
echo "Compressing with 7z" echo "Compressing with 7z"
7z a "${OUTPUT_NAME:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort 7z a "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort
elif [ "$COMPRESS_FORMAT" = "xz" ]; then elif [ "$COMPRESS_FORMAT" = "xz" ]; then
echo "Compressing with tar xz" echo "Compressing with tar xz"
if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_NAME:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name"); then if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name"); then
echo "Out of memory? Trying again with single threads..." echo "Out of memory? Trying again with single threads..."
tar -cPJvf "${OUTPUT_NAME:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort tar -cPJvf "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort
fi fi
elif [ "$COMPRESS_FORMAT" = "zip" ]; then elif [ "$COMPRESS_FORMAT" = "zip" ]; then
7z -tzip a "${OUTPUT_NAME:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort 7z -tzip a "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort
fi fi
else else
rm -rf "${OUTPUT_NAME:?}" || abort rm -rf "${OUTPUT_PATH:?}" || abort
cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_NAME" || abort cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_PATH" || abort
fi fi
echo -e "done\n" echo -e "done\n"