Created
December 13, 2022 13:10
-
-
Save Treast/e829e3afb56464cbd8b4522e47f9a623 to your computer and use it in GitHub Desktop.
A simple Bash script to create archives for projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
folder=${1%/} | |
version=$2 | |
if [ -z "$1" ]; then | |
echo "Usage ./create_archive.sh FOLDER/ VERSION" | |
exit 1 | |
fi | |
zip -r -qq "${folder}-v${version}.zip" "${folder}/" -x '/*.git/*' | |
tar jcf "${folder}-v${version}.tar.bz2" --exclude-vcs "${folder}/" | |
tar zcf "${folder}-v${version}.tar.gz" --exclude-vcs "${folder}/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment