fix one more shlex.split

This commit is contained in:
svlandeg 2020-06-29 18:37:42 +02:00
parent ff233d5743
commit 1176783310

View File

@ -246,7 +246,7 @@ def project_clone(
run_command(["git", "-C", str(tmp_dir), "fetch"]) run_command(["git", "-C", str(tmp_dir), "fetch"])
run_command(["git", "-C", str(tmp_dir), "checkout"]) run_command(["git", "-C", str(tmp_dir), "checkout"])
shutil.move(str(tmp_dir / Path(name).name), str(project_dir)) shutil.move(str(tmp_dir / Path(name).name), str(project_dir))
msg.good(f"Cloned project '{name}' from {repo}") msg.good(f"Cloned project '{name}' from {repo} into {project_dir}")
for sub_dir in DIRS: for sub_dir in DIRS:
dir_path = project_dir / sub_dir dir_path = project_dir / sub_dir
if not dir_path.exists(): if not dir_path.exists():
@ -484,7 +484,7 @@ def update_dvc_config(
path = path.resolve() path = path.resolve()
dvc_config_path = path / DVC_CONFIG dvc_config_path = path / DVC_CONFIG
if dvc_config_path.exists(): if dvc_config_path.exists():
# Cneck if the file was generated using the current config, if not, redo # Check if the file was generated using the current config, if not, redo
with dvc_config_path.open("r", encoding="utf8") as f: with dvc_config_path.open("r", encoding="utf8") as f:
ref_hash = f.readline().strip().replace("# ", "") ref_hash = f.readline().strip().replace("# ", "")
if ref_hash == config_hash and not force: if ref_hash == config_hash and not force:
@ -578,7 +578,7 @@ def run_commands(
for command in commands: for command in commands:
# Substitute variables, e.g. "./{NAME}.json" # Substitute variables, e.g. "./{NAME}.json"
command = command.format(**variables) command = command.format(**variables)
command = shlex.split(command) command = shlex.split(command, posix=not is_windows)
# TODO: is this needed / a good idea? # TODO: is this needed / a good idea?
if len(command) and command[0] == "python": if len(command) and command[0] == "python":
command[0] = sys.executable command[0] = sys.executable