-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·48 lines (43 loc) · 1.23 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·48 lines (43 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
# Install `guildr` as a global CLI.
#
# Prefers `uv tool install` (fast, isolated). Falls back to `pipx`,
# then to `pip install --user`. After this, `guildr run --config ...`
# works from anywhere on PATH.
#
# Usage:
# ./install.sh # install
# ./install.sh --upgrade # reinstall from current source
set -euo pipefail
cd "$(dirname "$0")"
mode="install"
if [[ "${1:-}" == "--upgrade" ]]; then
mode="upgrade"
fi
# Build the PWA bundle so `guildr` can serve the web UI out of the box.
if [[ -x web/frontend/build.sh ]]; then
echo ">> Building PWA bundle"
web/frontend/build.sh
fi
if command -v uv >/dev/null 2>&1; then
echo ">> Installing via uv tool"
if [[ "$mode" == "upgrade" ]]; then
uv tool install --reinstall --editable .
else
uv tool install --editable .
fi
elif command -v pipx >/dev/null 2>&1; then
echo ">> Installing via pipx"
if [[ "$mode" == "upgrade" ]]; then
pipx install --force --editable .
else
pipx install --editable .
fi
else
echo ">> uv and pipx not found — falling back to pip --user"
python3 -m pip install --user --editable .
fi
echo
echo "Installed. Try:"
echo " guildr --help"
echo " guildr run --from-env --dry-run --project /tmp/test-project"