Script running in parent folder
Posted: Mon Sep 03, 2012 5:32 pm
I'm trying to get a rule running to regenerate a ctags file every time something in my ~/src folder changes. (Incidentally, you might want to change the condition that matches extensions to ignore a beginning period; it took me a while to figure out why I could touch .py files without the rule executing.)
I'm watching the ~/src folder, with a rule set to trigger and process subfolders if there's a file in them where the last matched date is before the last modified date, or if the last matched date is blank. (Another thing you might consider is having a blank last matched date always be considered prior to any other date.) That rule works.
I then have another rule that runs the following script if it finds a file with a source code extension that's changed since last being matched, or if the last match date is blank. This is the script:
The problem I'm having is that the tags file isn't being generated in the code subdirectory as I want it to, but in the parent directory. Which is to say the script is creating the file ~/src/tags, not ~/src/<source directory>/tags. So I'm assuming that the script is running in the parent directory, not the child directory where the changed file actually is. Is this the expected behavior?
I'm watching the ~/src folder, with a rule set to trigger and process subfolders if there's a file in them where the last matched date is before the last modified date, or if the last matched date is blank. (Another thing you might consider is having a blank last matched date always be considered prior to any other date.) That rule works.
I then have another rule that runs the following script if it finds a file with a source code extension that's changed since last being matched, or if the last match date is blank. This is the script:
- Code: Select all
/Applications/BBEdit.app/Contents/Helpers/ctags --excmd=number -f tags --tag-relative=no --fields=+a+m+n+S -R $1
The problem I'm having is that the tags file isn't being generated in the code subdirectory as I want it to, but in the parent directory. Which is to say the script is creating the file ~/src/tags, not ~/src/<source directory>/tags. So I'm assuming that the script is running in the parent directory, not the child directory where the changed file actually is. Is this the expected behavior?