Add better installer

This commit is contained in:
Antonio J. Delgado 2024-11-16 22:54:10 +02:00
parent d9bcafe3e3
commit 3b3944c893
3 changed files with 35 additions and 3 deletions

View file

@ -11,9 +11,14 @@ See requirements.txt
### Linux
You can use the Bash script from the cloned folder (it will create a virtual environment for it, and do the installation of requirements), or you can install breaking system packages with:
To install for example in your ~/.local/bin folder:
```bash
pip install . --break-system-packages
./install.sh --destination ~/.local/bin
```
To install system-wide:
```bash
sudo ./install.sh --destination /usr/local/bin
```
## Usage

24
install.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
destination="/usr/local/bin"
while [ $# -gt 0 ]
do
case "$1" in
"--help"|"-h"|"-?")
usage
exit 0
;;
"--destination"|"-d")
shift
destination="${1}"
shift
;;
*)
echo "Ignoring unknwon parameter '${1}'"
shift
;;
esac
done
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
sed "s#__src_folder__#${script_dir}#g" wrapper.sh > "${destination}/nc_password_client.sh"
chmod +x "${destination}/nc_password_client.sh"

3
wrapper.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
cd "__src_folder__" || exit 1
"__src_folder__/nc_password_client.sh" "${@}"