From cb7f38c554cb98644509b7fdca49dd476f95ecd0 Mon Sep 17 00:00:00 2001 From: Martin Bektchiev Date: Thu, 26 Mar 2015 17:09:06 +0200 Subject: [PATCH] CB-8757 Make paths with --link relative to the real project path --- cordova-lib/src/plugman/platforms/ios.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cordova-lib/src/plugman/platforms/ios.js b/cordova-lib/src/plugman/platforms/ios.js index 2719dcb2c..6a9771322 100644 --- a/cordova-lib/src/plugman/platforms/ios.js +++ b/cordova-lib/src/plugman/platforms/ios.js @@ -49,7 +49,7 @@ function installHelper(type, obj, plugin_dir, project_dir, plugin_id, options, p // Make the Xcode reference the file directly. // Note: Can't use path.join() here since it collapses 'Plugins/..', and xcode // library special-cases Plugins/ prefix. - project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, trueSrc)); + project_ref = 'Plugins/' + fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc)); } else { common.copyNewFile(plugin_dir, srcFile, project_dir, destFile, link); project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, destFile)); @@ -75,7 +75,7 @@ function uninstallHelper(type, obj, project_dir, plugin_id, options, project) { var link = !!(options && options.link); if (link) { var trueSrc = fs.readlinkSync(destFile); - project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, trueSrc)); + project_ref = 'Plugins/' + fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc)); } else { project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, destFile)); }