diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d344e82 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SHELL=/bin/bash + +ifndef VERBOSE +.SILENT: +endif + +.PHONY: install +install: ## Install Pixipin on the local host. + ./install_from_git_checkout.sh + +.PHONY: test +test: ## Run the test suite. + ./test.sh + +.PHONY: check +check: ## Run linters, checkers, etc.. + pre-commit run -a + +.PHONY: help +help: ##xx Print this help message. + echo "" + echo "Usage: make " + echo "" + echo "main commands:" + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}' + echo "" + echo "other commands:" + @grep -E '^[a-zA-Z_-]+:.*?##xx .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##xx "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/README.md b/README.md index c0825cc..30dfd12 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,7 @@ pixipin automatically downloads and caches the pixi executibles. ## Installation ``` - # Installation - sudo curl -o /usr/local/bin/pixi https://raw.githubusercontent.com/Ali-Piccioni/pixipin/main/pixipin - sudo chmod a+x /usr/local/bin/pixi - - # Make sure pixi points to /usr/local/bin/pixi - # If not, then you need to either remove the - # standard pixi or promote pixipin in your PATH. - which pixi + curl -sSL https://raw.githubusercontent.com/Ali-Piccioni/pixipin/main/install.sh | sudo bash ``` ## Usage diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..1462910 --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root (use sudo)" + exit 1 +fi + +curl -o /usr/local/bin/pixi https://raw.githubusercontent.com/Ali-Piccioni/pixipin/main/pixipin +chmod a+x /usr/local/bin/pixi diff --git a/install_from_git_checkout.sh b/install_from_git_checkout.sh new file mode 100755 index 0000000..2620136 --- /dev/null +++ b/install_from_git_checkout.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root (use sudo)" + exit 1 +fi + +cd $(git rev-parse --show-toplevel) +cp pixipin /usr/local/bin/pixi +chmod a+x /usr/local/bin/pixi +which pixi diff --git a/pixi.lock b/pixi.lock index 05f3c7b..a1c5fc7 100644 --- a/pixi.lock +++ b/pixi.lock @@ -37,6 +37,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb9d3cd8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.9.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda @@ -83,6 +84,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.46.1-hc14010f_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libssh2-1.11.0-h7a5bd25_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/make-4.4.1-hc9fafa5_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h7bae524_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.9.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.2-h8359307_0.conda @@ -927,6 +929,37 @@ packages: license_family: Other size: 60963 timestamp: 1727963148474 +- kind: conda + name: make + version: 4.4.1 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb9d3cd8_2.conda + sha256: d652c7bd4d3b6f82b0f6d063b0d8df6f54cc47531092d7ff008e780f3261bdda + md5: 33405d2a66b1411db9f7242c8b97c9e7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: GPL-3.0-or-later + license_family: GPL + size: 513088 + timestamp: 1727801714848 +- kind: conda + name: make + version: 4.4.1 + build: hc9fafa5_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/make-4.4.1-hc9fafa5_2.conda + sha256: 90ca65e788406d9029ae23ad4bd944a8b5353ad5f59bd6ce326f980cde46f37e + md5: 9f44ef1fea0a25d6a3491c58f3af8460 + depends: + - __osx >=11.0 + license: GPL-3.0-or-later + license_family: GPL + size: 274048 + timestamp: 1727801725384 - kind: conda name: ncurses version: '6.5' diff --git a/pixi.toml b/pixi.toml index 635d689..98fb8e7 100644 --- a/pixi.toml +++ b/pixi.toml @@ -12,3 +12,4 @@ version = "0.1.0" shellcheck = ">=0.10.0,<0.11" git = ">=2.47.0,<3" pre-commit = ">=4.0.1,<5" +make = ">=4.4.1,<5" diff --git a/pixipin b/pixipin index c6ef550..a8b0553 100755 --- a/pixipin +++ b/pixipin @@ -1,6 +1,6 @@ #!/usr/bin/env bash -PIXIPIN_CACHE_DIR=${PIXIPIN_CACHE_DIR:-/tmp/pixipin} +PIXIPIN_CACHE_DIR=${PIXIPIN_CACHE_DIR:-$HOME/.pixipin/cache/bin} log() { echo pixipin: "$@" >&2