summaryrefslogtreecommitdiffstats
path: root/ship
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-12-11 00:55:30 +0100
committermakefu <github@syntax-fehler.de>2013-12-11 00:55:30 +0100
commit893c529590c68c0d0c1fdd1e39f442023f434404 (patch)
tree4a3bd513562f835c32b81d776666ce639c40097f /ship
parent22205a0c0ecde1885860346707773aaffe01e9b3 (diff)
add @strict macro, fix @info for code not under version control (private code)
Diffstat (limited to 'ship')
-rwxr-xr-xship/build16
1 files changed, 14 insertions, 2 deletions
diff --git a/ship/build b/ship/build
index 5863e325..2051a7db 100755
--- a/ship/build
+++ b/ship/build
@@ -40,12 +40,22 @@ EOF
fi
}
+## usage: #@strict -> build_strict_mode \1
+build_strict_mode() { cat<<EOF
+$1a\\
+set -euf\\
+set -o posix || true
+EOF
+}
+
## usage: #@info -> build_info \1
-build_info() { cat<<EOF
+build_info() {
+ gitinfo=$(git describe --always --dirty --abbrev=0 2>/dev/null || true)
+cat<<EOF
$1a\\
# this file was generated by //ship/build\\
# build date: $(date -u --rfc-3339=s)\\
-# git describe: $(git describe --always --dirty --abbrev=0)
+# git describe: ${gitinfo:-not under version control}
EOF
}
@@ -177,6 +187,8 @@ buildcache_add() {
echo "$1" >> "$buildcache"
}
+
+
###
### main invocation
###