- Shell: "✅ Command executed successfully" → "⚡️ ran successfully" - Write file: Remove ✏️ emoji, use plain "wrote N lines | M chars"
39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Build and install g3 and studio to ~/.local/bin
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
INSTALL_DIR="$HOME/.local/bin"
|
|
mkdir -p "$INSTALL_DIR"
|
|
|
|
echo "Building g3 and studio (release)..."
|
|
cargo build --release
|
|
|
|
echo "Installing to $INSTALL_DIR..."
|
|
cp target/release/g3 "$INSTALL_DIR/"
|
|
cp target/release/studio "$INSTALL_DIR/g3-studio"
|
|
cp target/release/libVisionBridge.dylib "$INSTALL_DIR/"
|
|
|
|
# Create symlink to override Android Studio's 'studio' command
|
|
# Remove existing symlink if present, but don't remove if it's a different file
|
|
if [ -L "$INSTALL_DIR/studio" ]; then
|
|
rm "$INSTALL_DIR/studio"
|
|
fi
|
|
ln -s "$INSTALL_DIR/g3-studio" "$INSTALL_DIR/studio"
|
|
|
|
echo "Done! Installed:"
|
|
echo " $INSTALL_DIR/g3"
|
|
echo " $INSTALL_DIR/g3-studio"
|
|
echo " $INSTALL_DIR/studio -> g3-studio"
|
|
echo " $INSTALL_DIR/libVisionBridge.dylib"
|
|
|
|
# Check if ~/.local/bin is in PATH
|
|
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
|
|
echo ""
|
|
echo "⚠️ $INSTALL_DIR is not in your PATH"
|
|
echo " Add this to your shell rc file:"
|
|
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
|
|
fi
|