Skip to content

Commit 5898e18

Browse files
committed
Change the export sha script to use a clone/checkout to be able to submodule
1 parent 1f8c86f commit 5898e18

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lib/export-sha.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
#!/bin/bash
2-
git archive $1 | tar -x -C $2
2+
bare=$(pwd)
3+
dest=$2
4+
sha=$1
5+
6+
if [ -d $dest ]
7+
then
8+
if [ ! -d $dest/.git ]
9+
then
10+
rm -rf $dest
11+
git clone $bare $dest
12+
fi
13+
else
14+
git clone $bare $dest
15+
fi
16+
cd $dest
17+
git fetch
18+
git checkout --force $sha
19+
git reset --hard $sha
20+
git submodule update --init

0 commit comments

Comments
 (0)