aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/init
diff options
context:
space:
mode:
authorwinter2025-01-18 22:41:17 +0000
committerwinter2025-01-18 22:49:41 +0000
commitf1a48c521472bde1c8668e29f8c5c792e1dd9f9f (patch)
tree21b89bf89204371de7a94042d8ed3d02c29d8516 /bin/init
parent5d55ae009cab1fe82f456111585d20795f4e865a (diff)
init script & fix the version info thing
yeah so turns out $Id$ is not what it seems
Diffstat (limited to 'bin/init')
-rwxr-xr-xbin/init19
1 files changed, 19 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'