juggle
juggle is a command line utility that sits and watches files and takes action on changes.
describe what you want watched and what you want to do in the manifest.json
Videos
Introduction
Complex Scenario
Install
npm install -g cli-juggle
Example manifest.json
{
"watch":[
{
"who":{
"path":"./less",
"regex":"\\.less$"
},
"action":{
"cmds":[
{
"name":"LESS => CSS",
"cmd": "lessc",
"args":[
"{{fullfile}}",
"css/{{filename}}.css"
]
}
]
}
},
...
]
}
Usage
aclark >> juggle manifest.json
Replacement Variables
{{fullfile}} # full file name 'home/less/style.less'
{{fileext}} # file extension '.less'
{{path}} # path of file 'home/less'
{{filename}} # name of file 'style'
{{pathindex path 0}} # name of index 0 in path 'home'
Example
#Terminal Window 1
ls example
juggle manifest.json
#Terminal Window 2
ls example
touch ./less/style.less
Limitations
- As of 0.1.0 this will not work on
Windows
due to limitations in the syncExec package. - On
OSX
you will need Xcode installed.
Todo
- tie in growl/notification support
- more tests
- better example
add commands to juggle to create manifests