add install target to build script

This commit is contained in:
asrael 2025-11-27 21:37:23 -06:00
parent 4d70dd03be
commit 3dccce8a81

17
pxl8.sh
View file

@ -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 "$@"
;;