diff --git a/pxl8.sh b/pxl8.sh index 4380b92..c7bb611 100755 --- a/pxl8.sh +++ b/pxl8.sh @@ -104,6 +104,7 @@ print_usage() { echo " build Build pxl8" echo " clean Remove build artifacts" echo " help Show this help message" + echo " install Install pxl8 to ~/.local/bin" echo " run Build and run pxl8 (optional: cart.pxc or folder)" echo " update Download/update all dependencies" echo " vendor Fetch source for dependencies (ex. SDL3)" @@ -468,6 +469,22 @@ case "$COMMAND" in update_sdl ;; + install) + "$0" build --release || exit 1 + + INSTALL_DIR="${HOME}/.local/bin" + mkdir -p "$INSTALL_DIR" + + cp "bin/release/pxl8" "$INSTALL_DIR/pxl8" + chmod +x "$INSTALL_DIR/pxl8" + + print_info "Installed pxl8 to $INSTALL_DIR/pxl8" + + if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then + print_info "Note: Add $INSTALL_DIR to your PATH if not already" + fi + ;; + ase) bash tools/aseprite/pxl8-ase.sh "$@" ;;