Replace python with sys.executable

This commit is contained in:
Ines Montani 2020-06-25 12:26:53 +02:00
parent 8131a65dee
commit 82a03ee18e

View File

@ -8,6 +8,7 @@ import shlex
import os import os
import re import re
import shutil import shutil
import sys
from ._app import app, Arg, Opt, COMMAND from ._app import app, Arg, Opt, COMMAND
from .. import about from .. import about
@ -190,8 +191,12 @@ def run_commands(commands: List[str] = tuple(), variables: Dict[str, str] = {})
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)
print(command) command = shlex.split(command)
run_command(shlex.split(command)) # TODO: is this needed / a good idea?
if len(command) and command[0] == "python":
command[0] = sys.executable
print(" ".join(command))
run_command(command)
def check_asset(url: str) -> None: def check_asset(url: str) -> None: