aboutsummaryrefslogtreecommitdiff
path: root/bin/archive
diff options
context:
space:
mode:
Diffstat (limited to 'bin/archive')
-rwxr-xr-xbin/archive22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/archive b/bin/archive
index 4d4c37a..d79d411 100755
--- a/bin/archive
+++ b/bin/archive
@@ -10,7 +10,9 @@ BASEDIR="$DIRNAME/.."
#ARCHIVE="$BASEDIR/archive"
ARCHIVE="archive"
ASSETS="build"
-REVISION="`git describe --tags 2> /dev/null || git log -1 --format=oneline | cut -d ' ' -f 1`"
+#REVISION="`git describe --tags 2> /dev/null || git log -1 --format=oneline | cut -d ' ' -f 1`"
+METADATA=".metadata"
+LATEST="$METADATA/latest.txt"
# Determine the revision file
if [ -e "$ASSETS/revision" ]; then
@@ -39,24 +41,24 @@ if [ ! -e "$REVFILE" ]; then
echo "# $BASENAME: skipping: revision file not found"
exit
else
- OLD_REVISION="`cat $REVFILE`"
+ REVISION="`cat $REVFILE`"
fi
# Check for non-null revision
-if [ -z "$OLD_REVISION" ]; then
+if [ -z "$REVISION" ]; then
echo "# $BASENAME: skipping: old revision is null"
exit
fi
-# Check if it's a tag
-if git tag | grep -q "^${OLD_REVISION}"; then
+# Check if the revision is a tag
+if git tag | grep -q "^${REVISION}$"; then
# Check if archive does not exists
- if [ ! -d "$ARCHIVE/$OLD_REVISION" ]; then
- echo "# $BASENAME: archiving $OLD_REVISION..."
- cp -alf $ASSETS $ARCHIVE/$OLD_REVISION
+ if [ ! -d "$ARCHIVE/$REVISION" ]; then
+ echo "# $BASENAME: archiving $REVISION..."
+ cp -alf $ASSETS $ARCHIVE/$REVISION
else
- echo "# $BASENAME: revision $OLD_REVISION already archived"
+ echo "# $BASENAME: revision $REVISION already archived"
fi
else
- echo "# $BASENAME: not archiving: revision $OLD_REVISION is not a tag"
+ echo "# $BASENAME: not archiving: revision $REVISION is not a tag"
fi