From 3dccce8a812ab3fee97c61f772b7a408161cbb54 Mon Sep 17 00:00:00 2001 From: asrael Date: Thu, 27 Nov 2025 21:37:23 -0600 Subject: [PATCH] add install target to build script --- pxl8.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 "$@" ;;