Skip to content

Commit 40e4546

Browse files
committed
Add iko/install.sh
1 parent 6cce9ab commit 40e4546

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

iko/install.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
set -euo pipefail
4+
5+
INSTALL_DIR="$HOME/.local/bin"
6+
WRAPPER="$INSTALL_DIR/iko"
7+
8+
mkdir -p "$INSTALL_DIR"
9+
10+
cat > "$WRAPPER" <<'EOF'
11+
#!/bin/sh
12+
13+
docker run --rm -it \
14+
-v "${PWD}/migrations:/repo:rw" \
15+
-v "${PWD}/scripts:/scripts:ro" \
16+
ghcr.io/explodinglabs/iko:0.1.0 "$@"
17+
EOF
18+
19+
chmod +x "$WRAPPER"
20+
21+
if ! echo "$PATH" | grep -q "$INSTALL_DIR"; then
22+
echo "✅ Installed iko to $WRAPPER"
23+
echo "⚠️ Warning: $INSTALL_DIR is not in your PATH. Add this to your shell profile:"
24+
echo 'export PATH="$HOME/.local/bin:$PATH"'
25+
else
26+
echo "✅ Installed iko. You can now run: iko"
27+
fi

0 commit comments

Comments
 (0)