-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathsetup.sh
More file actions
37 lines (33 loc) · 1.21 KB
/
setup.sh
File metadata and controls
37 lines (33 loc) · 1.21 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
abort() {
printf "%s\n" "$@" >&2
exit 1
}
execute() {
if ! "$@"
then abort "$(printf "Failed: %s" "$@")"
fi
}
execute_root() {
execute "sudo" "$@"
}
echo "Installing Python..."
execute_root "wget" "-O" "python-install.sh" "https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/python-install.sh"
execute_root "/bin/bash" "python-install.sh"
echo "Cleaning up..."
execute_root "rm" "python-install.sh"
echo "Installing dependencies..."
execute_root "pip-leads" "install" "leads[vec]"
echo "Creating executable entries..."
execute_root "echo" "#!/bin/bash" > "/bin/leads-vec"
execute_root "echo" 'python-leads -m leads_vec "$@"' >> "/bin/leads-vec"
execute_root "chmod" "+x" "/bin/leads-vec"
execute_root "echo" "#!/bin/bash" > "/bin/leads-vec-rc"
execute_root "echo" 'python-leads -m leads_vec_rc "$@"' >> "/bin/leads-vec-rc"
execute_root "chmod" "+x" "/bin/leads-vec-rc"
execute_root "echo" "#!/bin/bash" > "/bin/leads-vec-dp"
execute_root "echo" 'python-leads -m leads_vec_dp "$@"' >> "/bin/leads-vec-dp"
execute_root "chmod" "+x" "/bin/leads-vec-dp"
execute_root "chmod" "666" "/usr/local/leads/venv/lib/python3.12/site-packages/leads/_ltm/core"
echo "Verifying..."
execute "leads-vec" "info"