feature: allow comments in CMD_FLAGS.txt (#127)

---------

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
This commit is contained in:
deevis 2023-09-22 14:22:24 -06:00 committed by oobabooga
parent 08e7ee4c4c
commit 7f0ea4dc16

View File

@ -17,7 +17,7 @@ conda_env_path = os.path.join(script_dir, "installer_files", "env")
cmd_flags_path = os.path.join(script_dir, "CMD_FLAGS.txt")
if os.path.exists(cmd_flags_path):
with open(cmd_flags_path, 'r') as f:
CMD_FLAGS = ' '.join(line.strip() for line in f.read().splitlines() if line.strip())
CMD_FLAGS = ' '.join(line.strip() for line in f if line.strip() and not line.strip().startswith('#'))
else:
CMD_FLAGS = ''