aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/init19
-rwxr-xr-xbin/update-version9
2 files changed, 28 insertions, 0 deletions
diff --git a/bin/init b/bin/init
new file mode 100755
index 0000000..61d5fdd
--- /dev/null
+++ b/bin/init
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+cd "$(dirname "$0")"/.. || exit 1
+
+if ! command -v composer >/dev/null; then
+ echo 'You need composer installed! https://getcomposer.org/download/' >/dev/stderr
+ exit 1
+fi
+
+if [ -d .git ]; then
+ # seems likely we are running inside a git clone rather than an exported archive
+ # install the hook so that version info is updated on every commit/checkout
+ ln -s ../../bin/update-version .git/hooks/post-commit
+ ln -s ../../bin/update-version .git/hooks/post-checkout
+ # and run it now
+ bin/update-version
+fi
+
+composer install && echo 'Done! Now edit config.ini to your liking, and then run bin/migrate'
diff --git a/bin/update-version b/bin/update-version
new file mode 100755
index 0000000..b9b3d21
--- /dev/null
+++ b/bin/update-version
@@ -0,0 +1,9 @@
+#!/bin/bash
+cd "$(dirname "$0")" || exit 1
+[ -L "$(basename "$0")" ] && cd "$(dirname "$(readlink "$(basename "$0")")")"
+if ! git describe --tags 2>/dev/null > ../VERSION; then
+ printf 'git ' > ../VERSION
+ git rev-parse --short HEAD >> ../VERSION
+fi
+printf 'stored version: '
+cat ../VERSION \ No newline at end of file