Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
parser.add_argument('-f', '--config-file', default='conf.json')
parser.add_argument('-l', '--log-folder', default='logs')
parser.add_argument('-t', '--tmp-folder', default='temp')
parser.add_argument('-w', '--web-folder', default='web')
args = vars(parser.parse_args())

TEMP_FOLDER = args['tmp_folder']
LOG_FOLDER = args['log_folder']
WEB_FOLDER = args['web_folder']

CONFIG_FOLDER = args['config_dir']
if os.path.isabs(args['config_file']):
Expand All @@ -59,7 +61,7 @@ def main():
project_path = os.getcwd()

try:
tool_utils.validate_web_build_exists(project_path)
tool_utils.validate_web_build_exists(os.path.realpath(WEB_FOLDER))
except InvalidWebBuildException as e:
print(str(e))
sys.exit(-1)
Expand Down
4 changes: 1 addition & 3 deletions src/utils/tool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
from utils import file_utils


def validate_web_build_exists(project_path):
web_folder = os.path.join(project_path, 'web')

def validate_web_build_exists(web_folder):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a closer look, the difference now is that we don't print the whole path. We could use os.path.realpath(web_folder), what do you think?

how_to_fix_build_message = \
'How to fix: ' \
'\n - PROD: please use stable releases from https://github.com/bugy/script-server/releases/latest' \
Expand Down