Skip to content

Instantly share code, notes, and snippets.

@ashee
Created February 2, 2011 21:22
Show Gist options
  • Save ashee/808468 to your computer and use it in GitHub Desktop.
Save ashee/808468 to your computer and use it in GitHub Desktop.
SCRIPT="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
BASEDIR=$(cd `dirname $0` && pwd)
BASEDIRNAME=$(basename $BASEDIR | tr \\n \ | sed -e 's/ $//' )
# BASEDIRNAME can now be used e.g. to create a tarball
tar cvzf "${BASEDIRNAME}.tgz" target/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment