Skip to content

Commit

Permalink
Rename TARGET to TARGET_DIRNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v committed Nov 25, 2024
1 parent b12373a commit 8c2922b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions release/package_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ fi

BUILD_DIR="$WORK_DIR/build-$1"
ARCHIVE_DIR="$BUILD_DIR/release-archive"
TARGET="scrcpy-$1-$VERSION"
TARGET_DIRNAME="scrcpy-$1-$VERSION"

rm -rf "$ARCHIVE_DIR/$TARGET"
mkdir -p "$ARCHIVE_DIR/$TARGET"
rm -rf "$ARCHIVE_DIR/$TARGET_DIRNAME"
mkdir -p "$ARCHIVE_DIR/$TARGET_DIRNAME"

cp -r "$BUILD_DIR/dist/." "$ARCHIVE_DIR/$TARGET/"
cp "$WORK_DIR/build-server/server/scrcpy-server" "$ARCHIVE_DIR/$TARGET/"
cp -r "$BUILD_DIR/dist/." "$ARCHIVE_DIR/$TARGET_DIRNAME/"
cp "$WORK_DIR/build-server/server/scrcpy-server" "$ARCHIVE_DIR/$TARGET_DIRNAME/"

mkdir -p "$OUTPUT_DIR"

cd "$ARCHIVE_DIR"
rm -f "$OUTPUT_DIR/$TARGET.$FORMAT"
rm -f "$OUTPUT_DIR/$TARGET_DIRNAME.$FORMAT"

case "$FORMAT" in
zip)
zip -r "$OUTPUT_DIR/$TARGET.zip" "$TARGET"
zip -r "$OUTPUT_DIR/$TARGET_DIRNAME.zip" "$TARGET_DIRNAME"
;;
tar.gz)
tar cvf "$OUTPUT_DIR/$TARGET.tar.gz" "$TARGET"
tar cvf "$OUTPUT_DIR/$TARGET_DIRNAME.tar.gz" "$TARGET_DIRNAME"
;;
*)
echo "Invalid format (expected zip or tar.gz): $FORMAT" >&2
exit 1
esac

rm -rf "$TARGET"
rm -rf "$TARGET_DIRNAME"
cd -
echo "Generated '$OUTPUT_DIR/$TARGET.$FORMAT'"
echo "Generated '$OUTPUT_DIR/$TARGET_DIRNAME.$FORMAT'"

0 comments on commit 8c2922b

Please sign in to comment.