This is still beta, so no docs are available
'scripts':
'sync': 'node foo'
'hooks':
'onSave':
'{bar, baz}': 'sync'
'{bar, baz}': ['lint', 'sync']
'{bar, baz}':conf
'*.scss': 'compile'
'*.js': ['lint', 'compile']
onSave
— triggered, after file save
Create an issue if you want some more hooks
If you are working with remote server, you probably need a way to upload changed files back to the server. This can be done using onSave
hook with rsync
and ssh
:
"*":
"atom-hooks":
hooks:
onSave:
"~/path/to/project/**": "rsync -rltvzR -e ssh ${project}/./${relative} user@host:~/path/to/remote/project"
For the following path /path/to/the/project/src/file.js
you will get the next variables to use in your scripts:
{
project: '/path/to/the/project',
root: '/',
path: '/path/to/the/project/src/file.js',
relative: 'src/file.js',
dir: '/path/to/the/project/src',
base: 'file.js',
ext: '.js',
name: 'file'
}