Skip to content

Commit

Permalink
package_release.sh: Linting errors and use /usr/bin/env
Browse files Browse the repository at this point in the history
  • Loading branch information
jpentland committed Mar 7, 2024
1 parent a7b4969 commit 6c1625b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions script/package_release.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash
#!/usr/bin/env bash
set -x
PROJECT=ChatPlaysRTS
version=$1
zipfile=$PROJECT-$version.zip

if ! [ -n "$version" ]; then
echo "Usage: $(basename $0) version" 1>&2
if [ -z "$version" ]; then
echo "Usage: $(basename "$0") version" 1>&2
exit 1
fi

mkdir -p .tmp/$PROJECT
files=$(git ls-tree -r HEAD --name-only | grep -v "^\.gitignore$")
rsync -R $files .tmp/$PROJECT
pushd .tmp
zip -r $zipfile $PROJECT
mv $zipfile ../
popd
rm -rf .tmp
rsync -R "$files" .tmp/$PROJECT
pushd .tmp || exit 1
zip -r "$zipfile" $PROJECT
mv "$zipfile" ../
popd || exit 1
rm -rf .tmp

0 comments on commit 6c1625b

Please sign in to comment.