aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorJan T <jan@jantuomi.fi>2025-11-13 11:31:30 +0000
committerJan Tuomi <jan@jantuomi.fi>2025-11-13 13:34:38 +0200
commit3df80b5afbebbf3af63b49fe98a3faecd2b68439 (patch)
tree3db37a25de23b7a6b21b3df261b84dc1359c1555 /install.sh
Initial commit
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..ca562df
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+if [ -z tools ]; then
+ echo "Error: tools directory not found. Run this script from the root directory."
+ exit 1
+fi
+
+cd tools
+
+# read TARGET without newline after prompt
+read -p "Install to? [default:/usr/local/bin] " TARGET
+
+if [ -z "$TARGET" ]; then
+ TARGET="/usr/local/bin"
+fi
+TARGET="$(eval echo "$TARGET")"
+
+(set -x; mkdir -p "$TARGET")
+
+for file in *; do
+ (set -x; ln -s "$(realpath "$file")" "$TARGET/$file") || true
+done