-
Notifications
You must be signed in to change notification settings - Fork 163
Provide a filename-only placeholder for exec #100
base: master
Are you sure you want to change the base?
Conversation
Say we want to run unit-tests when the current file `foo.js` is saved. Our tests require that the following command is run: `node tests\test-foo.js` In order for this to work we need a `${filename}` placeholder which returns only `foo.js` and not the full path (as `${file}` currently does). ```javascript "exec": { "afterSave": { "*.js": "node tests/test-${filename}.js" } } ```
Thanks for the Christmas present! |
Ho ho ho! I have an update/addition. If you run exec in a subfolder (foo/) it seems to remain in the projectDir so you need the subpath Should we adapt my code above or add a new ${filenamer} (filename __r__elative): def("${filenamer}", function() {
var p = editor.getFilePath();
return p.substring((window.fsroot || getDir()).length+1);
}); |
Can you do a rebase and add this change to the current pull request? Or On Wed, Dec 26, 2012 at 8:38 AM, cawoodm [email protected] wrote:
|
Renamed ${filename} to ${fileName} Added ${fileBase} and ${filePath}
OK, I went with: |
@aeisenberg can you merge my https://github.com/cawoodm/scripted/commit/dfbbd33fbabe0fcc034c8dc67e4063efcfc8c98b changes? |
Marc - I'm afraid we are still waiting for a contributor agreement to be setup so that you can sign it and we can take the contribution. I'm really hoping it'll be in the next few days. |
Say we want to run unit-tests when the current file
foo.js
is saved. Our tests require that the following command is run:node tests\test-foo.js
In order for this to work we need a
${filename}
placeholder which returns onlyfoo.js
and not the full path (as${file}
currently does).