Socket
Socket
Sign inDemoInstall

jake

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jake - npm Package Compare versions

Comparing version 0.2.11 to 0.2.12

17

lib/task/task.js
var fs = require('fs')
, path = require('path')
, EventEmitter = require('events').EventEmitter

@@ -95,13 +96,17 @@ , Task

// Task doesn't exist, assume static file -- create a
// dummy FileTask if file actually exists
// Task doesn't exist, may be a static file
if (!prereq) {
filePath = name.split(':')[1] || name;
try {
// Create a dummy FileTask if file actually exists
if (path.existsSync(filePath)) {
stats = fs.statSync(filePath);
prereq = new jake.FileTask(name);
prereq.modTime = stats.mtime;
// Put this dummy Task in the global Tasks list so
// modTime will be eval'd correctly
jake.Task[parsed.name] = prereq;
}
catch(e) {
throw new Error('Prerequisite file ' + name + ' does not exist');
// Otherwise it's not a valid task
else {
throw new Error('Unknown task "' + name + '"');
}

@@ -111,3 +116,3 @@ }

// Do when done
prereq.addListener('complete', function () {
prereq.once('complete', function () {
self.handlePrereqComplete(prereq);

@@ -114,0 +119,0 @@ });

{
"name": "jake",
"version": "0.2.11",
"version": "0.2.12",
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",

@@ -5,0 +5,0 @@ "bin": {

@@ -33,4 +33,3 @@ var assert = require('assert')

h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task',
out);
assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task', out);
h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {

@@ -65,3 +64,16 @@ // Second time should be a no-op

assert.equal(prereqData, data.toString());
cleanUpAndNext();
h.exec('../bin/cli.js fileTest:foo/from-prereq.txt', function (out) {
// Second time should be a no-op
assert.equal('', out);
cleanUpAndNext();
/*
h.exec('../bin/cli.js fileTest:touch-prereq', function () {
h.exec('../bin/cli.js fileTest:foo/from-prereq.txt', function (out) {
// Third time should update the target file
assert.equal('fileTest:foo/from-prereq.txt task', out);
cleanUpAndNext();
});
});
*/
});
});

@@ -68,0 +80,0 @@ });

@@ -70,2 +70,9 @@ var assert = require('assert')

this.testSamePrereqTwice = function () {
h.exec('../bin/cli.js foo:asdf', function (out) {
assert.equal('foo:bar task\nfoo:baz task\nfoo:asdf task', out);
});
h.next();
};
this.testPrereqWithCmdlineArgs = function () {

@@ -72,0 +79,0 @@ h.exec('../bin/cli.js foo:qux', function (out) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc