Open pavankris opened 9 years ago
{relFullPath}
is from the save-commands plugin.
i'm assuming what you're looking for is ${dir}
?
On Sep 25, 2015 8:23 AM, "Pavan Krishnamurthy" notifications@github.com wrote:
my save-autorun.cson in my project dir is
'**.c' : 'astyle --options=myastyle.cfg {relFullPath}'
— Reply to this email directly or view it on GitHub https://github.com/hyperfresh/save-autorun/issues/1.
sorry i had {file} , i was trying some other package too. '**.c' : 'astyle --options=myastyle.cfg {file}'
Is there a way to debug even if this command is run or not on save ?
there is the save-autorun:execute-definitions
command that you can use to manually trigger just the commands for the file you currently have open.
if that doesn't trigger any commands, or at the very least not show any notifications, that should mean that there's no definitions for that file. other than that, i haven't put it any debug messages yet, sorry :<
if you want to know for sure using the methods in the package that your file is not triggering any commands you can open up the console View > Developer > Toggle Developer Tools
and type in this JS in the console:
atom.packages.getLoadedPackage('save-autorun').mainModule.definitions.get(atom.workspace.getActiveTextEditor().getPath())
this accesses this method directly from the API which returns an array of commands that saving should trigger for the file you currently have open (before the variables are replaced).
this should give you something like:
if the array is empty, then the file you're trying to save is not matching any definitions in save-autorun.cson
if the array isn't empty, then i have to ask if the issue is they're not running at all or they're running but throwing errors.
another command you can try accesses this variable containing the currently loaded save-autorun.cson
.
atom.packages.getLoadedPackage('save-autorun').mainModule.definitions.cson
which looks like:
by the way, the variable should be ${file}
, not {file}
, so the correct definition would be
'**.c' : 'astyle --options=myastyle.cfg ${file}'
I think this happens when you modify .save.cson. Apparently you need to reload atom in order for it to pick the new rules.
my save-autorun.cson in my project dir is
'**.c' : 'astyle --options=myastyle.cfg {relFullPath}'