Skip to content

Commit

Permalink
fix issue joh#64: Feature request: variable for what just changed
Browse files Browse the repository at this point in the history
A WHEN_CHANGED_FILE environment variable is set with the path of the file that has just changed.

Signed-off-by: Eric Villard <[email protected]>
  • Loading branch information
eviweb committed Mar 27, 2019
1 parent 51ecaca commit ba3081f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions whenchanged/whenchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def run_command(self, thefile):
print_message += '.' + now.strftime('%f') + ", running '" + ' '.join(self.command) + "'"
if print_message:
print('==> ' + print_message + ' <==')
self.set_envvar('file', thefile)
subprocess.call(new_command, shell=(len(new_command) == 1), env=self.process_env)
self.last_run = time.time()

Expand Down

0 comments on commit ba3081f

Please sign in to comment.