Add GSP init and AI usage tooling
This commit is contained in:
27
toolkit/scripts/install.sh
Normal file
27
toolkit/scripts/install.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
TOOLKIT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
INSTALL_DIR=${GSP_INSTALL_DIR:-"$HOME/.gsp/bin"}
|
||||
TARGET="$INSTALL_DIR/gsp"
|
||||
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
|
||||
(
|
||||
cd "$TOOLKIT_DIR"
|
||||
go build -o "$TARGET" ./cmd/gsp
|
||||
)
|
||||
|
||||
chmod +x "$TARGET"
|
||||
|
||||
echo "Installed gsp to $TARGET"
|
||||
case ":$PATH:" in
|
||||
*":$INSTALL_DIR:"*) ;;
|
||||
*)
|
||||
echo "Add this to your shell profile if gsp is not found:"
|
||||
echo "export PATH=\"$INSTALL_DIR:\$PATH\""
|
||||
;;
|
||||
esac
|
||||
|
||||
"$TARGET" version
|
||||
Reference in New Issue
Block a user