Skip to content

Commit e6bddcb

Browse files
committed
Change directory before executing a command.
1 parent 097b7b9 commit e6bddcb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/smart_dispatch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ def main():
6464

6565
# Add redirect for output and error logs
6666
for i, command in enumerate(commands):
67+
# Change directory before executing command
68+
commands[i] = 'cd {cwd}; '.format(cwd=os.getcwd()) + commands[i]
69+
# Log command's output and command's error
6770
log_filename = os.path.join(path_job_logs, smartdispatch.generate_name_from_command(command, max_length_arg=30))
6871
commands[i] += ' 1>> "{output_log}"'.format(output_log=log_filename + ".o")
6972
commands[i] += ' 2>> "{error_log}"'.format(error_log=log_filename + ".e")

0 commit comments

Comments
 (0)