Skip to content

Commit

Permalink
Correct Watcher file path concatenation (#937)
Browse files Browse the repository at this point in the history
Fixes issue where files created in the modified directory where missing delimiters.
e.g. nano-themenano-theme.el vs. nano-theme/nano-theme.el
Reported using watchexec v 1.18.6
  • Loading branch information
aaronjensen committed Mar 28, 2022
1 parent 5e9ca86 commit dafbd50
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions watcher/straight_watch_callback.py
Expand Up @@ -51,10 +51,7 @@ def main(args):
die("straight_watch_callback.py: watchexec gave no modified files")
if WATCHEXEC_VAR_COMMON in os.environ:
common = os.environ[WATCHEXEC_VAR_COMMON]
# Yes, string concatentation. For some reason when a common
# prefix is used, the individual paths start with a slash even
# though they're actually relative to the prefix.
paths = [common + path for path in paths]
paths = [os.path.join(common, path) for path in paths]
paths = [pathlib.Path(path).resolve() for path in paths]
paths = sorted(set(paths))
repos = set()
Expand Down

0 comments on commit dafbd50

Please sign in to comment.