aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
blob: ca562df5258e932f06077e4863c2e8117884604f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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