From 980481ecf02afad386e24af1adc8f20083c08008 Mon Sep 17 00:00:00 2001 From: Doug Martin Date: Fri, 18 Jul 2014 17:06:47 -0500 Subject: [PATCH] v0.2.2 --- .travis.yml | 2 +- README.md | 8 ++++++++ package.json | 2 +- tasks/lib/linker.js | 13 +++++++------ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2abfde..9579b5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,4 @@ before_script: - npm install -g grunt-cli language: node_js node_js: - - 0.8 + - 0.1 diff --git a/README.md b/README.md index 241df3e..fa353a7 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,14 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. ## Release History +2014-07-16 v0.2.2 +- Changed to use `npm link` when initially linking modules + + +2014-07-16 v0.2.1 +- Updated `package.json` for correct repo + + 2014-07-16 v0.2.0 - Using symlinks instead of `npm link` to improve performance. - Improved logging. diff --git a/package.json b/package.json index e65ace9..dcd5c66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grunt-link", "description": "Grunt task to handle the linking of local dependencies", - "version": "0.2.1", + "version": "0.2.2", "homepage": "https://github.com/doug-martin/grunt-link.git", "author": { "name": "Doug Martin", diff --git a/tasks/lib/linker.js b/tasks/lib/linker.js index 5e7e2fe..c1f8769 100644 --- a/tasks/lib/linker.js +++ b/tasks/lib/linker.js @@ -26,7 +26,7 @@ module.exports = function (grunt, npm, options) { return comb.async.array(cmds).forEach(function (cmd) { if (cmd) { log.debug(util.format("Executing %s %s", cmd.cmd, cmd.args.join(" "))); - var child = execP(cmd.cmd, cmd.args, { stdio: "inherit" }), + var child = execP(cmd.cmd, cmd.args, { stdio: "inherit" }), ret = new comb.Promise(); child.on("close", function (code) { @@ -42,7 +42,7 @@ module.exports = function (grunt, npm, options) { }, 1); } - function createModulesDir (dir, deps) { + function createModulesDir(dir, deps) { var statP = new comb.Promise(); if (deps.length < 1) { log.debug("No linked dependencies needed"); @@ -60,7 +60,7 @@ module.exports = function (grunt, npm, options) { } function chdir(location) { - var newLoc = path.resolve(cwd, normalizeName(location)) + var newLoc = path.resolve(cwd, normalizeName(location)); log.debug("Changing directory to " + newLoc); process.chdir(newLoc); } @@ -82,7 +82,7 @@ module.exports = function (grunt, npm, options) { } } if (options.clean && install) { - log.debug(util.format("Executing rimraf %s", loc+"/node_modules")); + log.debug(util.format("Executing rimraf %s", loc + "/node_modules")); cleanPromise = rimraf(path.resolve(loc, "./node_modules")); } else { cleanPromise = comb.async.array(removeDirs).forEach(function (dir) { @@ -123,8 +123,9 @@ module.exports = function (grunt, npm, options) { if (i === 0) { log.subhead("Linking modules"); } + chdir(pkg[0]); if (isBoolean(pkg[2]) ? pkg[2] : true) { - return exec({ cmd: "ln", args: ["-s", getPackageName(pkg[0]), npm.globalDir]}); + return exec({ cmd: "npm", args: ["link"]}); } }, 1) .forEach(function (pkg, i) { @@ -163,5 +164,5 @@ module.exports = function (grunt, npm, options) { } return exec(cmds); }); - },1); + }, 1); };