• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

atom-hooks

Execute commands depending on file path and editor events (e.g. save)
SleepWalker
0.3.2 98
2
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

Atom hooks package

Build Status (osx, linux) Build status (windows) Dependency Status

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']

Supported hooks

  • onSave — triggered, after file save

Create an issue if you want some more hooks

Usage

Rsync file on save

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:
        "~/path/to/project/**": "rsync -rltvzR -e ssh ${project}/./${relative} user@host:~/path/to/remote/project"

Available script variables

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'
}

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by