Skip to content

Commit

Permalink
write pixi binaries to home dir cache (#4)
Browse files Browse the repository at this point in the history
* write pixi binaries to home dir cache

* provide install script
  • Loading branch information
AliPiccioniQC authored Nov 5, 2024
1 parent 049650d commit 7e8b438
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 9 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 <command>"
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}'
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions install_from_git_checkout.sh
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion pixipin
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7e8b438

Please sign in to comment.