Skip to content

Commit

Permalink
Add -- support for --powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Jun 11, 2019
1 parent adcac21 commit ec781fe
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/rezplugins/shell/powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,13 @@ def _record_shell(ex, files, bind_rez=True, print_msg=False):
else:
_record_shell(executor, files=startup_sequence["files"], print_msg=(not quiet))

if shell_command:
executor.command(shell_command)

code = executor.get_output()
target_file = os.path.join(tmpdir, "rez-shell.%s"
% self.file_extension())
target_file = os.path.join(
tmpdir, "rez-shell.%s" % self.file_extension()
)

with open(target_file, 'w') as f:
f.write(code)
Expand All @@ -200,11 +204,11 @@ def _record_shell(ex, files, bind_rez=True, print_msg=False):
if not isinstance(cmd, (tuple, list)):
cmd = pre_command.rstrip().split()

cmd += [self.executable, "-noexit"]
cmd += [self.executable]
cmd += ['. "{}"'.format(target_file)]

if shell_command:
cmd += shell_command
if not shell_command:
cmd.insert(1, "-noexit")

p = popen(cmd,
env=env,
Expand Down

0 comments on commit ec781fe

Please sign in to comment.