Skip to content

Instantly share code, notes, and snippets.

@ruthenium
Forked from Tanner/extensionize.sh
Created August 16, 2016 15:26
Show Gist options
  • Save ruthenium/1a84bfe726fc220106e81db173750595 to your computer and use it in GitHub Desktop.
Save ruthenium/1a84bfe726fc220106e81db173750595 to your computer and use it in GitHub Desktop.
Creates a zip file without .git, .gitignore, or .DS_Store
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: ${0} directory"
exit 1
fi
if [ -d ${1} ]; then
DIR_NAME=$(basename ${1})
echo "Creating zip file..."
zip -rq $DIR_NAME.zip ${1} -x ${1}/.git/\* ${1}/.gitignore ${1}/.DS_Store
echo "All done!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment