Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
Gulp.prototype.watch = function (glob, opt, fn) {
if (typeof opt === 'function' || Array.isArray(opt)) {
fn = opt;
opt = null;
}
// array of tasks given
if (Array.isArray(fn)) {
return vfs.watch(glob, opt, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opt, fn);
};
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
Assemble.prototype.watch = function(glob, options, fn) {
if (typeof options === 'function' || Array.isArray(options)) {
fn = options;
options = null;
}
// Tasks to watch
if (Array.isArray(fn)) {
return fs.watch(glob, options, function() {
this.start.apply(this, fn);
}.bind(this));
}
return fs.watch(glob, options, fn);
};
Assemble.prototype.watch = function(glob, opts, fn) {
if (Array.isArray(opts) || typeof opts === 'function') {
fn = opts; opts = null;
}
if (Array.isArray(fn)) {
return vfs.watch(glob, opts, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opts, fn);
};
Assemble.prototype.watch = function(glob, opts, fn) {
if (Array.isArray(opts) || typeof opts === 'function') {
fn = opts; opts = null;
}
if (Array.isArray(fn)) {
return vfs.watch(glob, opts, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opts, fn);
};
Verb.prototype.watch = function (glob, opts, fn) {
if (Array.isArray(opts) || typeof opts === 'function') {
fn = opts;
opts = null;
}
if (Array.isArray(fn)) {
return vfs.watch(glob, opts, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opts, fn);
};
.option('style-indent-size', {
default: 2,
help: 'Number of characters used for indentation of styles'
})
.script('sprity')
.parse();
opts.logger = log;
opts.cli = true;
if (opts.watch) {
if (opts['no-sort']) {
opts.sort = false;
}
log('Watching for file changes ...');
fs.watch(opts.src, function () {
sprite.create(opts, function () {
log.success('Sprite created in ' + opts.out);
});
});
}
else {
if (opts['no-sort']) {
opts.sort = false;
}
sprite.create(opts, function () {
log.success('Sprite created in ' + opts.out);
});
}
Verb.prototype.watch = function (glob, opts, fn) {
if (Array.isArray(opts) || typeof opts === 'function') {
fn = opts;
opts = null;
}
if (Array.isArray(fn)) {
return vfs.watch(glob, opts, function () {
this.start.apply(this, fn);
}.bind(this));
}
return vfs.watch(glob, opts, fn);
};
if(cb || opt.reload){
opt.onHandleEnd = function(next, ev){
if(this instanceof Stack && (this.queue || this.host)){return ;}
if(util.shouldReloadFile(opt, ev)){
delete require.cache[ev.path];
require(ev.path);
}
if(cb){ cb(ev, opt); }
};
}
var tasks = util.type(opt.tasks);
if(tasks.string || tasks.array){
tasks = tasks.string || tasks.array.join(' ');
return vinylFS.watch(glob, this.stack(tasks, opt));
}
return vinylFS.watch(glob, opt, opt.onHandleEnd);
};