forked from jwiegley/git-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
super basic but working git-archive-all
- Loading branch information
Arthur Axel 'fREW' Schmidt
committed
Nov 6, 2010
1 parent
9105a0a
commit 075b88c
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Super basic tool to export repo and all submodules | ||
# as a single zip file | ||
|
||
# USAGE: git archive-all foo | ||
# generates foo.zip | ||
|
||
OUTFILE=$1 | ||
|
||
git ls-files --cached --full-name --no-empty-directory -z \ | ||
| xargs -0 zip "$OUTFILE.zip" > /dev/null | ||
|
||
git submodule --quiet foreach --recursive \ | ||
'perl -e " | ||
print join qq(\0), | ||
map qq($path/\$_), | ||
split /\0/, | ||
qx(git ls-files -z --cached --full-name --no-empty-directory); | ||
print qq(\0)" | ||
' | xargs -0 zip "$OUTFILE.zip" > /dev/null | ||
|