Skip to content

Commit

Permalink
fix: install script (#276)
Browse files Browse the repository at this point in the history
TODO: nc not found, sudo apt install netcat-openbsd
  • Loading branch information
ocervell committed Apr 11, 2024
1 parent 4f976bd commit e27b339
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions scripts/install.sh
Expand Up @@ -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
Expand All @@ -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"
8 changes: 4 additions & 4 deletions secator/cli.py
Expand Up @@ -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.',
Expand All @@ -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.',
Expand All @@ -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.',
Expand All @@ -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.',
Expand Down
2 changes: 2 additions & 0 deletions secator/utils.py
Expand Up @@ -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}')
Expand Down

0 comments on commit e27b339

Please sign in to comment.