mkitt / watchn Goto Github PK
View Code? Open in Web Editor NEWIntelligently auto execute tasks on file/directory changes
Home Page: http://mkitt.github.com/watchn/
License: MIT License
Intelligently auto execute tasks on file/directory changes
Home Page: http://mkitt.github.com/watchn/
License: MIT License
There is no need to make the user add the .watchn after the command watchn .watchn
. It could be detected that one is present in the current working directory and used by default.
I was very excited to see this project. I setup a quick example and out of the box it isn't working for me when I monitor directories. If I watch a file then it works fine but the callback is not being fired when I watch directories.
var cp = require('child_process');
module.exports.init = function(watchn) {
// watchn.watch('build', ['./modules/js/AlertGrid.js'], function(options) { <--- this works fine
watchn.watch('build', ['./modules/js/'], function(options) {
console.log(options); // <------ doesn't execute when watching the directory
// File has changed
if (options.curr > options.prev) {
console.log('');
console.log('--------------------------------------');
console.log('CHANGE DETECTED');
console.log('--------------------------------------');
console.log('');
cp.exec('./build.sh -c', function(error, stdout, stderr) {
if (error !== null) {
console.log(stderr);
} else {
console.log(stdout);
}
})
}
})
}
This could be because of async calls within these libraries. Thought this was built in, but need to write some test cases to find out for sure.
Occasionally watchn crashes when a task fails. It generally happens when editing a .scss
file and that file contains errors when it is saved, but not always. It's rare and pure randomness. I've gone a few days without shutting watchn down and never see it. Not sure what the work around is since there doesn't seem to be a pattern related to it. For now, watchn should output a message or growl something to the user that its left the building
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.