Created
February 16, 2018 16:56
-
-
Save realeroberto/e659c55f9f9987d34a63ebcdf5a8bddb to your computer and use it in GitHub Desktop.
Create a tarball from inside a folder
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/sh | |
# create a tarball from inside a folder | |
dirname=$(cat PROJECT)-$(cat VERSION) | |
tarball=${dirname}.tar.gz | |
# avoid tar's error message ``file changed as we read it'' | |
touch "$tarball" | |
tar cfz "$tarball" \ | |
--transform "s,^\./,$dirname/," \ | |
--exclude=.svn --exclude="$tarball" \ | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment