-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·77 lines (63 loc) · 1.8 KB
/
install.sh
File metadata and controls
executable file
·77 lines (63 loc) · 1.8 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -eo pipefail
DEFAULT_PYTHON_VERSION="3.12"
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
list_installables() {
if [ -f "${script_dir}/installables/yoink.sh" ]; then
printf '%s\n' "${script_dir}/installables/yoink.sh"
fi
if [ -f "${script_dir}/installables/deno.sh" ]; then
printf '%s\n' "${script_dir}/installables/deno.sh"
fi
if [ -f "${script_dir}/installables/uv.sh" ]; then
printf '%s\n' "${script_dir}/installables/uv.sh"
fi
for x in "${script_dir}"/installables/*.sh; do
if ! [ -e "${x}" ]; then
continue
fi
case "$(basename "${x}")" in
yoink.sh|deno.sh|uv.sh)
continue
;;
esac
printf '%s\n' "${x}"
done
}
if [ "${1:-}" = "--list-installables" ]; then
list_installables
exit 0
fi
emit_outdated_install_commands() {
local target="/usr/local/bin/outdated"
printf '%q > %q\n' "${script_dir}/make-outdated.sh" "${target}"
printf 'chmod 755 %q\n' "${target}"
}
echo '# Runnables'
for X in "$script_dir"/runnables/*; do
base="$(basename "${X}")"
case "${base}" in
*.sh.in)
continue
;;
esac
x="${base%.*}"
case "${x}" in
python|pip)
for y in 3.10 3.11 3.12 3.13; do
target="/usr/local/bin/${x}$y"
printf 'install -m 755 %q %q\n' "$X" "$target"
printf 'sed -i %q %q %q\n' '' "s|^_python_version=|_python_version=$y|" "$target"
done
printf 'rm -f %q\n' "/usr/local/bin/${x}"
printf 'ln -s %q %q\n' "${x}3" "/usr/local/bin/${x}"
printf 'rm -f %q\n' "/usr/local/bin/${x}3"
printf 'ln -s %q %q\n' "${x}${DEFAULT_PYTHON_VERSION}" "/usr/local/bin/${x}3"
;;
*)
printf 'install -m 755 %q %q\n' "$X" "/usr/local/bin/${x}"
;;
esac
done
emit_outdated_install_commands
printf '\nrun: ./install.sh 2>/dev/null | sudo bash -exo pipefail && outdated\n' >&2