Skip to content

Instantly share code, notes, and snippets.

@Treast
Created December 13, 2022 13:10
Show Gist options
  • Save Treast/e829e3afb56464cbd8b4522e47f9a623 to your computer and use it in GitHub Desktop.
Save Treast/e829e3afb56464cbd8b4522e47f9a623 to your computer and use it in GitHub Desktop.
A simple Bash script to create archives for projects
#!/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