Skip to content

Commit

Permalink
(explicitly) find the executable before running run_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
majidaldo authored and jtcohen6 committed Apr 27, 2021
1 parent 33dc970 commit ca2a1cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/dbt/clients/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ def run_cmd(
logger.debug('Executing "{}"'.format(' '.join(cmd)))
if len(cmd) == 0:
raise dbt.exceptions.CommandError(cwd, cmd)
exe_pth = shutil.which(cmd[0])
if not exe:
# executable not found
raise dbt.exceptions.CommandError(cwd, cmd)
cmd = [exe_pth] + list(cmd[1:])

# the env argument replaces the environment entirely, which has exciting
# consequences on Windows! Do an update instead.
Expand Down

0 comments on commit ca2a1cc

Please sign in to comment.