Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof arg == 'function') {
definition = arg;
}
// Prereqs
else if (Array.isArray(arg) || typeof arg == 'string') {
prereqs = arg;
}
// Opts
else {
opts = arg;
}
}
}
this.prereqs = prereqs;
this.packageFiles = new FileList();
this.publishCmd = opts.publishCmd || 'npm publish %filename';
this.publishMessage = opts.publishMessage || 'BOOM! Published.';
this.gitCmd = opts.gitCmd || 'git';
this.versionFiles = opts.versionFiles || ['package.json'];
this.scheduleDelay = 5000;
// Override utility funcs for testing
this._ensureRepoClean = function (stdout) {
if (stdout.length) {
fail(new Error('Git repository is not clean.'));
}
};
this._getCurrentBranch = function (stdout) {
return utils.string.trim(stdout);
};
if (typeof arg == 'function') {
definition = arg;
}
// Prereqs
else if (Array.isArray(arg) || typeof arg == 'string') {
prereqs = arg;
}
// Opts
else {
opts = arg;
}
}
}
this.prereqs = prereqs;
this.packageFiles = new FileList();
this.publishCmd = opts.publishCmd || 'npm publish %filename';
this.publishMessage = opts.publishMessage || 'BOOM! Published.';
this.gitCmd = opts.gitCmd || 'git';
this.versionFiles = opts.versionFiles || ['package.json'];
this.scheduleDelay = 5000;
// Override utility funcs for testing
this._ensureRepoClean = function (stdout) {
if (stdout.length) {
fail(new Error('Git repository is not clean.'));
}
};
this._getCurrentBranch = function (stdout) {
return utils.string.trim(stdout);
};
if (typeof arg == 'function') {
definition = arg;
}
// Prereqs
else if (Array.isArray(arg) || typeof arg == 'string') {
prereqs = arg;
}
// Opts
else {
opts = arg;
}
}
}
this.prereqs = prereqs;
this.packageFiles = new FileList();
this.publishCmd = opts.publishCmd || 'npm publish %filename';
this.gitCmd = opts.gitCmd || 'git';
this.versionFiles = opts.versionFiles || ['package.json'];
this.scheduleDelay = 5000;
// Override utility funcs for testing
this._ensureRepoClean = function (stdout) {
if (stdout.length) {
fail(new Error('Git repository is not clean.'));
}
};
this._getCurrentBranch = function (stdout) {
return utils.string.trim(stdout);
};
if (typeof definition == 'function') {
if (typeof arg == 'function') {
definition = arg;
}
// Prereqs
else if (Array.isArray(arg) || typeof arg == 'string') {
prereqs = arg;
}
// Opts
else {
opts = arg;
}
}
}
this.prereqs = prereqs;
this.packageFiles = new FileList();
this.publishCmd = opts.publishCmd || 'npm publish %filename';
this.publishMessage = opts.publishMessage || 'BOOM! Published.';
this.gitCmd = opts.gitCmd || 'git';
this.versionFiles = opts.versionFiles || ['package.json'];
this.scheduleDelay = 5000;
// Override utility funcs for testing
this._ensureRepoClean = function (stdout) {
if (stdout.length) {
fail(new Error('Git repository is not clean.'));
}
};
this._getCurrentBranch = function (stdout) {
return utils.string.trim(stdout);
};
}
if (!(taskNames && taskNames.length)) {
throw new Error('Watch task needs some tasks to run');
}
name = name || 'watch';
definition = definition || function () {};
if (jake.Task[name]) {
throw new Error('WatchTask named "' + name + '" already exists. ' +
'Please use a different name.');
}
this.watchTasks = Array.isArray(taskNames) ? taskNames : [taskNames];
this.watchFiles = new FileList();
this.rootTask = task('watchTasks', this.watchTasks);
this.throttle = THROTTLE;
this.watchFiles.include(WatchTask.DEFAULT_INCLUDE_FILES);
this.watchFiles.exclude(WatchTask.DEFAULT_EXCLUDE_FILES);
if (typeof definition == 'function') {
definition.call(this);
}
desc('Runs these tasks: ' + this.watchTasks.join(', '));
task(name, function () {
console.log('WatchTask started for: ' + self.watchTasks.join(', '));
jake.watch('.', {includePattern: /.+/}, function (filePath) {
var fileMatch = self.watchFiles.toArray().some(function (item) {
return item == filePath;
}
if (!(taskNames && taskNames.length)) {
throw new Error('Watch task needs some tasks to run');
}
name = name || 'watch';
definition = definition || function () {};
if (jake.Task[name]) {
throw new Error('WatchTask named "' + name + '" already exists. ' +
'Please use a different name.');
}
this.watchTasks = Array.isArray(taskNames) ? taskNames : [taskNames];
this.watchFiles = new FileList();
this.rootTask = task('watchTasks', this.watchTasks);
this.throttle = THROTTLE;
this.watchFiles.include(WatchTask.DEFAULT_INCLUDE_FILES);
this.watchFiles.exclude(WatchTask.DEFAULT_EXCLUDE_FILES);
if (typeof definition == 'function') {
definition.call(this);
}
desc('Runs these tasks: ' + this.watchTasks.join(', '));
task(name, function () {
console.log('WatchTask started for: ' + self.watchTasks.join(', '));
jake.watch('.', {includePattern: /.+/}, function (filePath) {
var fileMatch = self.watchFiles.toArray().some(function (item) {
return item == filePath;
}
if (!(taskNames && taskNames.length)) {
throw new Error('Watch task needs some tasks to run');
}
name = name || 'watch';
definition = definition || function () {};
if (jake.Task[name]) {
throw new Error('WatchTask named "' + name + '" already exists. ' +
'Please use a different name.');
}
this.watchTasks = Array.isArray(taskNames) ? taskNames : [taskNames];
this.watchFiles = new FileList();
this.rootTask = task('watchTasks', this.watchTasks);
this.throttle = THROTTLE;
this.watchFiles.include(WatchTask.DEFAULT_INCLUDE_FILES);
this.watchFiles.exclude(WatchTask.DEFAULT_EXCLUDE_FILES);
if (typeof definition == 'function') {
definition.call(this);
}
desc('Runs these tasks: ' + this.watchTasks.join(', '));
task(name, function () {
console.log('WatchTask started for: ' + self.watchTasks.join(', '));
jake.watch('.', {includePattern: /.+/}, function (filePath) {
var fileMatch = self.watchFiles.toArray().some(function (item) {
return item == filePath;
this.prereqs = prereqs;
/**
@name jake.PackageTask#version
@public
@type {String='pkg'}
@description The directory-name to use for packaging the software
*/
this.packageDir = 'pkg';
/**
@name jake.PackageTask#packageFiles
@public
@type {jake.FileList}
@description The list of files and directories to include in the
package-archive
*/
this.packageFiles = new FileList();
/**
@name jake.PackageTask#needTar
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tgz archive of the package
*/
this.needTar = false;
/**
@name jake.PackageTask#needTar
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tar.gz archive of the package
*/
this.needTarGz = false;
this.prereqs = prereqs;
/**
@name jake.PackageTask#packageDir
@public
@type {String='pkg'}
@description The directory-name to use for packaging the software
*/
this.packageDir = 'pkg';
/**
@name jake.PackageTask#packageFiles
@public
@type {jake.FileList}
@description The list of files and directories to include in the
package-archive
*/
this.packageFiles = new FileList();
/**
@name jake.PackageTask#needTar
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tgz archive of the package
*/
this.needTar = false;
/**
@name jake.PackageTask#needTarGz
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tar.gz archive of the package
*/
this.needTarGz = false;
this.prereqs = prereqs;
/**
@name jake.PackageTask#version
@public
@type {String='pkg'}
@description The directory-name to use for packaging the software
*/
this.packageDir = 'pkg';
/**
@name jake.PackageTask#packageFiles
@public
@type {jake.FileList}
@description The list of files and directories to include in the
package-archive
*/
this.packageFiles = new FileList();
/**
@name jake.PackageTask#needTar
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tgz archive of the package
*/
this.needTar = false;
/**
@name jake.PackageTask#needTar
@public
@type {Boolean=false}
@description If set to true, uses the `tar` utility to create
a gzip .tar.gz archive of the package
*/
this.needTarGz = false;