Repository: cordova-lib Updated Branches: refs/heads/master 2cdd710dd -> 61de6302e
removed mostly unused relativePath checking and added missing cases for isAbsolutePath Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/61de6302 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/61de6302 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/61de6302 Branch: refs/heads/master Commit: 61de6302ee8e0467248add0b8c37ac8e57defcf9 Parents: 2cdd710 Author: Jesse MacFadyen <purplecabb...@gmail.com> Authored: Tue Apr 7 14:12:06 2015 -0700 Committer: Jesse MacFadyen <purplecabb...@gmail.com> Committed: Tue Apr 7 14:12:06 2015 -0700 ---------------------------------------------------------------------- cordova-lib/src/plugman/install.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/61de6302/cordova-lib/src/plugman/install.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/install.js b/cordova-lib/src/plugman/install.js index 8f66e64..ca15809 100644 --- a/cordova-lib/src/plugman/install.js +++ b/cordova-lib/src/plugman/install.js @@ -470,7 +470,7 @@ function tryFetchDependency(dep, install, options) { } // Test relative to parent folder - if( dep.url && isRelativePath(dep.url) ) { + if( dep.url && !isAbsolutePath(dep.url) ) { relativePath = path.resolve(install.top_plugin_dir, '../' + dep.url); if( fs.existsSync(relativePath) ) { @@ -585,13 +585,11 @@ function interp_vars(vars, text) { return text; } -function isAbsolutePath(path) { - return path && (path[0] === '/' || path[0] === '\\' || path.indexOf(':\\') > 0 ); +function isAbsolutePath(_path) { + // some valid abs paths: 'c:' '/' '\' and possibly ? 'file:' 'http:' + return _path && (_path.charAt(0) === path.sep || _path.indexOf(':') > 0); } -function isRelativePath(path) { - return !isAbsolutePath(path); -} // Copy or link a plugin from plugin_dir to plugins_dir/plugin_id. function copyPlugin(plugin_src_dir, plugins_dir, link, pluginInfoProvider) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org