Skip to content

Commit

Permalink
Add the source packaging utility
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Dec 31, 2019
1 parent fcb9214 commit d9b3fdd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/create-source-archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

if test "$#" -ne 1; then
echo "Usage: $0 <package-version>"
exit 1
fi

if test ! -d scripts; then
echo "Run this script from the project root."
exit 1
fi

package_version="$1"

project_remote=$(git config --get remote.origin.url)
project_name=$(basename -s .git "$project_remote")

git-archive-all --prefix="$project_name"-"$package_version"/ "$project_name"-"$package_version".tar
zopfli "$project_name"-"$package_version".tar
rm -f "$project_name"-"$package_version".tar
echo "$project_name"-"$package_version".tar.gz

0 comments on commit d9b3fdd

Please sign in to comment.