Skip to content

Commit

Permalink
create bin folder if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ocervell committed Apr 9, 2024
1 parent 12640f7 commit f3ae2e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions secator/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
LIB_FOLDER = ROOT_FOLDER + '/secator'
CONFIGS_FOLDER = LIB_FOLDER + '/configs'
EXTRA_CONFIGS_FOLDER = os.environ.get('SECATOR_EXTRA_CONFIGS_FOLDER')
BIN_FOLDER = os.environ.get('SECATOR_BIN_FOLDER', f'{os.path.expanduser("~")}/.local/bin')
DATA_FOLDER = os.environ.get('SECATOR_DATA_FOLDER', f'{os.path.expanduser("~")}/.secator')
REPORTS_FOLDER = os.environ.get('SECATOR_REPORTS_FOLDER', f'{DATA_FOLDER}/reports')
WORDLISTS_FOLDER = os.environ.get('SECATOR_WORDLISTS_FOLDER', f'{DATA_FOLDER}/wordlists')
Expand All @@ -32,6 +33,7 @@
PAYLOADS_FOLDER = f'{DATA_FOLDER}/payloads'
REVSHELLS_FOLDER = f'{DATA_FOLDER}/revshells'
TESTS_FOLDER = f'{ROOT_FOLDER}/tests'
os.makedirs(BIN_FOLDER, exist_ok=True)
os.makedirs(DATA_FOLDER, exist_ok=True)
os.makedirs(REPORTS_FOLDER, exist_ok=True)
os.makedirs(WORDLISTS_FOLDER, exist_ok=True)
Expand Down
5 changes: 2 additions & 3 deletions secator/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from secator.rich import console
from secator.runners import Command
from secator.definitions import GITHUB_TOKEN
from secator.definitions import BIN_FOLDER, GITHUB_TOKEN


class ToolInstaller:
Expand Down Expand Up @@ -104,8 +104,7 @@ def install(cls, github_handle):

# Download and unpack asset
console.print(f'Found release URL: {download_url}')
destination = os.path.join(os.path.expanduser("~"), ".local", "bin")
cls._download_and_unpack(download_url, destination, repo)
cls._download_and_unpack(download_url, BIN_FOLDER, repo)
return True

@classmethod
Expand Down

0 comments on commit f3ae2e5

Please sign in to comment.