Skip to content

Instantly share code, notes, and snippets.

@Tanner
Created September 18, 2012 02:12
Show Gist options
  • Save Tanner/3740883 to your computer and use it in GitHub Desktop.
Save Tanner/3740883 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