- Split into three projects: Library, Console, and Tests - Library compiles as QRScript.Interpreter to avoid conflicts
28 lines
759 B
Bash
Executable file
28 lines
759 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Install qrscript locally for current user (no sudo)
|
|
# Usage: ./install.sh ./dist/qrscript-linux/qrscript
|
|
|
|
set -e
|
|
|
|
PLATFORM="$1"
|
|
SOURCE_BIN="./dist/qrscript-$PLATFORM/qrscript"
|
|
INSTALL_DIR="$HOME/.local/bin"
|
|
TARGET="$INSTALL_DIR/qrscript"
|
|
|
|
if [[ ! -x "$SOURCE_BIN" ]]; then
|
|
echo "❌ Error: Provide a valid built qrscript binary as the first argument."
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$INSTALL_DIR"
|
|
cp "$SOURCE_BIN" "$TARGET"
|
|
chmod +x "$TARGET"
|
|
|
|
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
|
|
echo "⚠️ $INSTALL_DIR is not in your PATH. Consider adding this to your shell profile:"
|
|
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
|
|
else
|
|
echo "✅ Installed qrscript to $TARGET"
|
|
echo "Run 'qrscript --help' to get started."
|
|
fi
|