Skip to content

Commit

Permalink
support for osx
Browse files Browse the repository at this point in the history
stock osx comes with old bsd utils so /usr/bin/tar doesn't accept the
--concatenate option. luckily though stock osx comes with
/usr/bin/gnutar which is pretty much the same version as the gnu/linux
tar which accepts the --concatenate option.

if we're on osx (ie uname => Darwin) use gnutar rather than tar.
  • Loading branch information
Thibaud Cummings committed Jul 18, 2013
1 parent 796d98f commit 9c3dbd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-archive-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default
SEPARATE=0
VERBOSE=0

TARCMD=tar
[[ $(uname) == "Darwin" ]] && TARCMD=gnutar
FORMAT=tar
PREFIX=
TREEISH=HEAD
Expand Down Expand Up @@ -227,7 +229,7 @@ fi
if [ $SEPARATE -eq 0 ]; then
if [ $FORMAT == 'tar' ]; then
sed -e '1d' $TMPFILE | while read file; do
tar --concatenate -f "$superfile" "$file" && rm -f "$file"
$TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file"
done
elif [ $FORMAT == 'zip' ]; then
sed -e '1d' $TMPFILE | while read file; do
Expand Down

0 comments on commit 9c3dbd6

Please sign in to comment.