From 8367bf2b608d250d1a91e1d8551df25836777537 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 22 Oct 2022 18:57:06 +0800 Subject: [PATCH] Minor Changes --- scripts/build.sh | 11 ++++++----- scripts/run.sh | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 1357390..5db8571 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -865,19 +865,20 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then if [ "$FILE_EXT" = ".xz" ]; then FILE_EXT=".tar$FILE_EXT" fi + OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT" fi - rm -f "${OUTPUT_PATH:?}$FILE_EXT" || abort + rm -f "${OUTPUT_PATH:?}" || abort if [ "$COMPRESS_FORMAT" = "7z" ]; then echo "Compressing with 7z" - 7z a "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort + 7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort elif [ "$COMPRESS_FORMAT" = "xz" ]; then echo "Compressing with tar xz" - if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name"); then + if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name"); then echo "Out of memory? Trying again with single threads..." - tar -cPJvf "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort + tar -cPJvf "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi elif [ "$COMPRESS_FORMAT" = "zip" ]; then - 7z -tzip a "${OUTPUT_PATH:?}$FILE_EXT" "$WORK_DIR/wsa/$artifact_name" || abort + 7z -tzip a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi else rm -rf "${OUTPUT_PATH:?}" || abort diff --git a/scripts/run.sh b/scripts/run.sh index 7780eb0..fb1d03d 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -53,6 +53,7 @@ check_dependencies() { command -v 7z > /dev/null 2>&1 || NEED_INSTALL+=("p7zip-full") command -v setfattr > /dev/null 2>&1 || NEED_INSTALL+=("attr") command -v xz > /dev/null 2>&1 || NEED_INSTALL+=("xz-utils") + command -v unzip > /dev/null 2>&1 || NEED_INSTALL+=("unzip") } check_dependencies osrel=$(sed -n '/^ID_LIKE=/s/^.*=//p' /etc/os-release);