-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·44 lines (37 loc) · 1.27 KB
/
setup.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.27 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
#!/bin/bash
install_path_pipx_venvs="$HOME/.local/pipx/venvs"
venv_name="pyqt5"
install_path="${install_path_pipx_venvs}/${venv_name}" #default path for virtual
printf "Install python requirements into virtual venv\n"
printf "Install to default path : $install_path ? (Y/N)\n"
read will_install_to_path
if [[ "$will_install_to_path" == "n" ]] then
printf "Provide path:"
read install_path
safe_install_location=1;
if [[ "${install_path:0:1}" == "/" ]] then
safe_install_location=0;
if [[ "${install_path:0:6}" == "/home/" ]] then
safe_install_location=1;
fi;
fi;
if [[ ${safe_install_location} == 0 ]] then
printf "Abort, script does not want to write files outside homedir...\n"
exit
fi;
if [[ -d "$install_path" ]] then
printf "Abort, directory already exists...\n"
exit
fi;
elif [[ "$will_install_to_path" == "y" ]] then
if [[ ! -d "$install_path_pipx_venvs" ]] then
printf "Abort, directory $install_path_pipx_venvs does not exists...\n"
exit
fi;
else
printf "Invalid answer. Exiting\n"
exit
fi;
printf "Preparing virtual environment in : $install_path \n"
python3 -m venv ${install_path}
${install_path}/bin/python3 -m pip install pyqt5