-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·37 lines (30 loc) · 1.58 KB
/
install
File metadata and controls
executable file
·37 lines (30 loc) · 1.58 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
#!/bin/bash -e
{ cd "$(dirname $(realpath $0))" # realpath -s $0
chk_py_ver() {
command -v "$1" >/dev/null 2>&1 && {
version_check=$("$1" -c 'import sys; print(sys.version_info >= (3, 12))' 2>/dev/null)
[ "$version_check" = "True" ] && {
PYTHON=$(command -v "$1")
echo "Using $1 at \"$PYTHON\""; } } }
chk_py_pip() { "$PYTHON" -c "import pip" 2>/dev/null; }
[ -z "$PYTHON" ] && chk_py_ver "python" || :
[ -z "$PYTHON" ] && chk_py_ver "python3" || :
[ -z "$PYTHON" ] && chk_py_ver "python3.14" || :
[ -z "$PYTHON" ] && chk_py_ver "python3.13" || :
[ -z "$PYTHON" ] && chk_py_ver "python3.12" || :
[ -z "$PYTHON" ] && { echo "Unable to find a valid python install!"
exit 1; }
chk_py_pip || { echo "pip is not installed. Running ensurepip."
"$PYTHON" -m ensurepip || echo "Failed to run ensurepip ⎺⟍_⟨⍩⟩_⟋⎺"; }
chk_py_pip && "$PYTHON" -m pip install --break-system-packages -U pycryptodome cffi regex clipboard \
|| echo "Failed to run pip ⎺⟍_⟨⍩⟩_⟋⎺"
DEST=$([ "$(id -u)" -eq 0 ] && echo "/bin/☾" || (\
[ "$(uname)" == "Darwin" ] && echo "/usr/local/bin/☾" || (\
echo "$HOME/.local/bin/☾" )))
echo "Installing to \"$DEST\""
(rm "$DEST" || :) >/dev/null 2>&1
echo -e "#!/bin/sh\nulimit -s unlimited\nexec \"$PYTHON\" -S -u \"$(realpath moon.py)\" \"\$@\"" > "$DEST"
chmod a+x "$DEST"
echo "Preloading cache…"
"$DEST" -c '13ᐸ␛!ᐸ‹Welcome to ☾! ›3𝗻'
exit 0; }