Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4CD2610D07 for ; Wed, 24 Dec 2014 21:22:54 +0000 (UTC) Received: (qmail 93676 invoked by uid 500); 24 Dec 2014 21:22:54 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 93641 invoked by uid 500); 24 Dec 2014 21:22:54 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 93625 invoked by uid 99); 24 Dec 2014 21:22:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Dec 2014 21:22:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D933EA37EDE; Wed, 24 Dec 2014 21:22:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org Date: Wed, 24 Dec 2014 21:22:54 -0000 Message-Id: <838ace47456b495d92e6d42cea025c9b@git.apache.org> In-Reply-To: <665b95a523b84049a0fd42cac3862bc3@git.apache.org> References: <665b95a523b84049a0fd42cac3862bc3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cordova-lib git commit: CB-8217 Fix plugin add --link when plugin given as relative path CB-8217 Fix plugin add --link when plugin given as relative path Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/7e093635 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/7e093635 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/7e093635 Branch: refs/heads/master Commit: 7e093635280e47ce7202fa9876beb57e8a1183b3 Parents: 402d04b Author: Andrew Grieve Authored: Wed Dec 24 16:20:00 2014 -0500 Committer: Andrew Grieve Committed: Wed Dec 24 16:22:33 2014 -0500 ---------------------------------------------------------------------- cordova-lib/src/plugman/fetch.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/7e093635/cordova-lib/src/plugman/fetch.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js index 2170611..edc0d43 100644 --- a/cordova-lib/src/plugman/fetch.js +++ b/cordova-lib/src/plugman/fetch.js @@ -251,8 +251,10 @@ function copyPlugin(plugin_dir, plugins_dir, link) { var dest = path.join(plugins_dir, pinfo.id); shell.rm('-rf', dest); if (link) { - events.emit('verbose', 'Linking plugin "' + plugin_dir + '" => "' + dest + '"'); - fs.symlinkSync(plugin_dir, dest, 'dir'); + var isRelativePath = plugin_dir[1] != ':' && plugin_dir[0] != path.sep; + var fixedPath = isRelativePath ? path.join(path.relative(plugins_dir, process.env.PWD || process.cwd()), plugin_dir) : plugin_dir; + events.emit('verbose', 'Linking "' + dest + '" => "' + fixedPath + '"'); + fs.symlinkSync(fixedPath, dest, 'dir'); } else { shell.mkdir('-p', dest); events.emit('verbose', 'Copying plugin "' + plugin_dir + '" => "' + dest + '"'); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org