From e27b3391ea3a5c5a7898d3c02a5f409be44255f8 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 11 Apr 2024 18:55:28 -0400 Subject: [PATCH] fix: install script (#276) TODO: nc not found, sudo apt install netcat-openbsd --- scripts/install.sh | 8 ++++---- secator/cli.py | 8 ++++---- secator/utils.py | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index cc449b55..f5dc3df6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7,9 +7,9 @@ echo -e "🗄 ${YELLOW}Running apt update ...${NC}" sudo apt update echo -e "🗄 ${GREEN}Ran apt update successfully !${NC}\n" -echo -e "🗄 ${YELLOW}Installing Python and pipx ...${NC}" -sudo apt install -y python3-pip pipx -echo -e "🗄 ${GREEN}pipx installed successfully !${NC}\n" +echo -e "🗄 ${YELLOW}Installing pipx and git ...${NC}" +sudo apt install -y pipx git +echo -e "🗄 ${GREEN}pipx and git installed successfully !${NC}\n" echo -e "🗄 ${YELLOW}Setting \$PATH ...${NC}" export PATH=$PATH:~/.local/bin:~/go/bin @@ -28,5 +28,5 @@ echo -e "🗄 ${GREEN}secator installed successfully !${NC}\n" echo -e "🗄 ${YELLOW}Adding ~/go/bin and ~/.local/bin to \$PATH in .bashrc ...${NC}" echo "export PATH=$PATH:~/go/bin:~/.local/bin" >> ~/.bashrc -source ~/.bashrc +. ~/.bashrc echo -e "🗄 ${GREEN}\$PATH modified successfully !${NC}\n" diff --git a/secator/cli.py b/secator/cli.py index 33111020..cdce4af2 100644 --- a/secator/cli.py +++ b/secator/cli.py @@ -612,7 +612,7 @@ def addons(): def install_worker(): "Install worker addon." run_install( - cmd=f'{sys.executable} -m pip install .[worker]', + cmd=f'{sys.executable} -m pip install secator[worker]', title='worker addon', next_steps=[ 'Run "secator worker" to run a Celery worker using the file system as a backend and broker.', @@ -626,7 +626,7 @@ def install_worker(): def install_google(): "Install google addon." run_install( - cmd=f'{sys.executable} -m pip install .[google]', + cmd=f'{sys.executable} -m pip install secator[google]', title='google addon', next_steps=[ 'Set the "GOOGLE_CREDENTIALS_PATH" and "GOOGLE_DRIVE_PARENT_FOLDER_ID" environment variables.', @@ -639,7 +639,7 @@ def install_google(): def install_mongodb(): "Install mongodb addon." run_install( - cmd=f'{sys.executable} -m pip install .[mongodb]', + cmd=f'{sys.executable} -m pip install secator[mongodb]', title='mongodb addon', next_steps=[ '[dim]\[optional][/] Run "docker run --name mongo -p 27017:27017 -d mongo:latest" to run a local MongoDB instance.', @@ -653,7 +653,7 @@ def install_mongodb(): def install_redis(): "Install redis addon." run_install( - cmd=f'{sys.executable} -m pip install .[redis]', + cmd=f'{sys.executable} -m pip install secator[redis]', title='redis addon', next_steps=[ '[dim]\[optional][/] Run "docker run --name redis -p 6379:6379 -d redis" to run a local Redis instance.', diff --git a/secator/utils.py b/secator/utils.py index 2714602c..bedde9a5 100644 --- a/secator/utils.py +++ b/secator/utils.py @@ -416,6 +416,8 @@ def print_version(): location = info['location'] if status == 'outdated': console.print('[bold red] (outdated)[/]') + else: + console.print('') console.print(f'[bold gold3]Latest version[/]: {latest_version}', highlight=False) console.print(f'[bold gold3]Location[/]: {location}') console.print(f'[bold gold3]Python binary[/]: {sys.executable}')