Skip to content

Commit 13ded9b

Browse files
committed
Initial export script
1 parent 42fc0b0 commit 13ded9b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

export.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#/bin/bash
2+
set -e
3+
set -o nounset
4+
ME=$(basename "$0")
5+
6+
if [ "$#" -ne 1 ]; then
7+
echo "Usage $ME <path to export to (must not exist)>"
8+
exit 3
9+
fi
10+
11+
VERSION=$(grep -o "VERSION =.*" editor.html | sed 's/.*"\(.*\)";/\1/')
12+
echo "$VERSION"
13+
14+
if [ -z "$VERSION" ]; then
15+
echo "Version is blank, which means we can't continue"
16+
exit 6
17+
fi
18+
19+
LOCATION="$1"
20+
LOCATION="$LOCATION/$VERSION"
21+
if [ -e "$LOCATION" ]; then
22+
echo "You must export to a location that doesn't already exist"
23+
exit 4
24+
fi
25+
26+
27+
if [[ -n $(git status --porcelain) ]]; then
28+
echo "Failing due to dirty repo";
29+
exit 5;
30+
fi
31+
32+
33+
34+
echo "VERSION is $VERSION"
35+
echo git checkout-index -a --prefix=\""$LOCATION"\/\"
36+
echo git submodule foreach \'git checkout-index -a --prefix=\""$LOCATION"\/\$path/\"\'
37+
echo "Now you can run these if it all looks right"

0 commit comments

Comments
 (0)