Skip to content
Permalink
Browse files
Minor code cleanup (#802)
* Simplify require path

* Break up overly long comment line

* Remove some mentions of --fetch in comments

* Remove commented out code
  • Loading branch information
raphinesse committed Oct 14, 2019
1 parent 36a064d commit a1c6039268be7f51cb8e6a75772612a9f8733df2
Showing 4 changed files with 6 additions and 6 deletions.
@@ -237,7 +237,7 @@ describe('pkgJson', function () {
});

// Test #023 : if pkg.json and config.xml have no platforms/plugins/spec.
// and --save --fetch is called, use the pinned version or plugin pkg.json version.
// and --save is called, use the pinned version or plugin pkg.json version.
it('Test#023 : use pinned/lastest version if there is no platform/plugin version passed in and no platform/plugin versions in pkg.json or config.xml', function () {
const PLATFORM = 'ios';
const PLUGIN = 'cordova-plugin-geolocation';
@@ -349,7 +349,7 @@ describe('pkgJson', function () {
});
});

it('Test#010 : two platforms are added and removed correctly with --save --fetch', function () {
it('Test#010 : two platforms are added and removed correctly with --save', function () {
// No platforms installed nor saved in config or pkg.json yet.
expect(getPkgJson('cordova')).toBeUndefined();
expect(getCfg().getEngines()).toEqual([]);
@@ -279,7 +279,9 @@ function determinePluginTarget (projectRoot, cfg, target, fetchOptions) {
events.emit('verbose', 'Not checking npm info for ' + parsedSpec.package + ' because searchpath or noregistry flag was given');
}
// if noregistry or searchpath are true, then shouldUseNpmInfo is false. Just return target
// else run `npm info` on the target via registry.info so we could get engines elemenent in package.json. Pass that info to getFetchVersion which determines the correct plugin to fetch based on engines element.
// else run `npm info` on the target via registry.info so we could get
// engines elemenent in package.json. Pass that info to getFetchVersion
// which determines the correct plugin to fetch based on engines element.
return (shouldUseNpmInfo ? plugin_util.info([id])
.then(function (pluginInfo) {
return module.exports.getFetchVersion(projectRoot, pluginInfo, cordovaVersion);
@@ -49,8 +49,6 @@ function list (projectRoot, hooksRunner, opts) {
p = pluginsDict[id];
for (var depId in p.deps) {
var dep = pluginsDict[depId];
// events.emit('results', p.deps[depId].version);
// events.emit('results', dep != null);
if (!dep) {
txt = 'WARNING, missing dependency: plugin ' + id +
' depends on ' + depId +
@@ -35,7 +35,7 @@ var cordovaUtil = require('../cordova/util');
var superspawn = require('cordova-common').superspawn;
var PluginInfo = require('cordova-common').PluginInfo;
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
var variableMerge = require('../plugman/variable-merge');
var variableMerge = require('./variable-merge');

/* INSTALL FLOW
------------

0 comments on commit a1c6039

Please sign in to comment.