34 lines
960 B
Bash
Executable File
34 lines
960 B
Bash
Executable File
#!/bin/bash
|
|
# Install artifact-editor to ~/.local/bin
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
INSTALL_DIR="$HOME/.local/bin"
|
|
|
|
mkdir -p "$INSTALL_DIR"
|
|
|
|
# Create wrapper script
|
|
cat > "$INSTALL_DIR/artifact-editor" << 'WRAPPER'
|
|
#!/bin/bash
|
|
# artifact-editor wrapper - launches PyQt6 artifact editor
|
|
SCRIPT_DIR="PLACEHOLDER_DIR"
|
|
export PYTHONPATH="$SCRIPT_DIR/src:$PYTHONPATH"
|
|
exec python3 -m artifact_editor.cli "$@"
|
|
WRAPPER
|
|
|
|
# Replace placeholder with actual path
|
|
sed -i "s|PLACEHOLDER_DIR|$SCRIPT_DIR|g" "$INSTALL_DIR/artifact-editor"
|
|
chmod +x "$INSTALL_DIR/artifact-editor"
|
|
|
|
echo "Installed artifact-editor to $INSTALL_DIR/artifact-editor"
|
|
echo ""
|
|
echo "Usage:"
|
|
echo " artifact-editor diagram.puml # Edit existing file"
|
|
echo " artifact-editor -o new.puml # Create new file"
|
|
echo ""
|
|
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
|
|
echo "NOTE: Add $INSTALL_DIR to your PATH:"
|
|
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
|
|
fi
|