Skip to content

Commit f3d27b0

Browse files
committed
Merge pull request #1 from frioux/master
git-archive-all
2 parents dc5e391 + 075b88c commit f3d27b0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

git-archive-all

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Super basic tool to export repo and all submodules
4+
# as a single zip file
5+
6+
# USAGE: git archive-all foo
7+
# generates foo.zip
8+
9+
OUTFILE=$1
10+
11+
git ls-files --cached --full-name --no-empty-directory -z \
12+
| xargs -0 zip "$OUTFILE.zip" > /dev/null
13+
14+
git submodule --quiet foreach --recursive \
15+
'perl -e "
16+
print join qq(\0),
17+
map qq($path/\$_),
18+
split /\0/,
19+
qx(git ls-files -z --cached --full-name --no-empty-directory);
20+
print qq(\0)"
21+
' | xargs -0 zip "$OUTFILE.zip" > /dev/null
22+

0 commit comments

Comments
 (0)