node-version-use 1.5.32 → 1.5.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/cli.cjs CHANGED
@@ -47,10 +47,11 @@ var _default = function(argv, name) {
47
47
  }
48
48
  options.stdio = 'inherit'; // pass through stdio
49
49
  return (0, _index.default)(args[0], args[1], args.slice(2), options, function(err, results) {
50
- if (err) {
50
+ if (err && !err.results) {
51
51
  console.log(err.message);
52
52
  return (0, _exit.default)(ERROR_CODE);
53
53
  }
54
+ if (err) results = err.results;
54
55
  var errors = results.filter(function(result) {
55
56
  return !!result.error;
56
57
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/cli.js"],"sourcesContent":["import exit from 'exit';\nimport getopts from 'getopts-compat';\nimport run from './index.mjs';\n\nconst figures = {\n tick: '✔',\n cross: '✘',\n};\nconst ERROR_CODE = 13;\n\nexport default (argv, name) => {\n const options = getopts(argv.slice(1), {\n alias: { range: 'r', desc: 'd', silent: 's' },\n default: { range: 'major,even' },\n boolean: ['silent', 'desc'],\n stopEarly: true,\n });\n\n // define.option('-r, --range [range]', 'range type of major, minor, or patch with filters of lts, even, odd for version string expressions', 'major,even');\n // define.option('-s, --silent', 'suppress logging', false);\n options.sort = options.desc ? -1 : 1;\n\n const args = argv.slice(0, 1).concat(options._);\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${name} [version expression] [command]`);\n return exit(ERROR_CODE);\n }\n\n options.stdio = 'inherit'; // pass through stdio\n return run(args[0], args[1], args.slice(2), options, (err, results) => {\n if (err) {\n console.log(err.message);\n return exit(ERROR_CODE);\n }\n const errors = results.filter((result) => !!result.error);\n\n if (!options.silent) {\n console.log('\\n======================');\n results.forEach((res) => console.log(`${res.error ? figures.cross : figures.tick} ${res.version}${res.error ? ` Error: ${res.error.message}` : ''}`));\n console.log('\\n----------------------');\n console.log(`${name} ${args.map((x) => (x.indexOf(' ') >= 0 ? `\"${x}\"` : x)).join(' ')}`);\n console.log(`${figures.tick} ${results.length - errors.length} succeeded`);\n if (errors.length) console.log(`${figures.cross} ${errors.length} failed`);\n }\n exit(err || errors.length ? ERROR_CODE : 0);\n });\n};\n"],"names":["figures","tick","cross","ERROR_CODE","argv","name","options","getopts","slice","alias","range","desc","silent","default","boolean","stopEarly","sort","args","concat","_","length","console","log","exit","stdio","run","err","results","message","errors","filter","result","error","forEach","res","version","map","x","indexOf","join"],"mappings":";;;;+BAUA;;;eAAA;;;2DAViB;oEACG;4DACJ;;;;;;AAEhB,IAAMA,UAAU;IACdC,MAAM;IACNC,OAAO;AACT;AACA,IAAMC,aAAa;IAEnB,WAAe,SAACC,MAAMC;IACpB,IAAMC,UAAUC,IAAAA,sBAAO,EAACH,KAAKI,KAAK,CAAC,IAAI;QACrCC,OAAO;YAAEC,OAAO;YAAKC,MAAM;YAAKC,QAAQ;QAAI;QAC5CC,SAAS;YAAEH,OAAO;QAAa;QAC/BI,SAAS;YAAC;YAAU;SAAO;QAC3BC,WAAW;IACb;IAEA,4JAA4J;IAC5J,4DAA4D;IAC5DT,QAAQU,IAAI,GAAGV,QAAQK,IAAI,GAAG,CAAC,IAAI;IAEnC,IAAMM,OAAOb,KAAKI,KAAK,CAAC,GAAG,GAAGU,MAAM,CAACZ,QAAQa,CAAC;IAC9C,IAAIF,KAAKG,MAAM,GAAG,GAAG;QACnBC,QAAQC,GAAG,CAAC,AAAC,mCAAuC,OAALjB,MAAK;QACpD,OAAOkB,IAAAA,aAAI,EAACpB;IACd;IAEAG,QAAQkB,KAAK,GAAG,WAAW,qBAAqB;IAChD,OAAOC,IAAAA,cAAG,EAACR,IAAI,CAAC,EAAE,EAAEA,IAAI,CAAC,EAAE,EAAEA,KAAKT,KAAK,CAAC,IAAIF,SAAS,SAACoB,KAAKC;QACzD,IAAID,KAAK;YACPL,QAAQC,GAAG,CAACI,IAAIE,OAAO;YACvB,OAAOL,IAAAA,aAAI,EAACpB;QACd;QACA,IAAM0B,SAASF,QAAQG,MAAM,CAAC,SAACC;mBAAW,CAAC,CAACA,OAAOC,KAAK;;QAExD,IAAI,CAAC1B,QAAQM,MAAM,EAAE;YACnBS,QAAQC,GAAG,CAAC;YACZK,QAAQM,OAAO,CAAC,SAACC;uBAAQb,QAAQC,GAAG,CAAC,AAAC,GAA8CY,OAA5CA,IAAIF,KAAK,GAAGhC,QAAQE,KAAK,GAAGF,QAAQC,IAAI,EAAC,KAAiBiC,OAAdA,IAAIC,OAAO,EAAmD,OAAhDD,IAAIF,KAAK,GAAG,AAAC,WAA4B,OAAlBE,IAAIF,KAAK,CAACJ,OAAO,IAAK;;YAC/IP,QAAQC,GAAG,CAAC;YACZD,QAAQC,GAAG,CAAC,AAAC,GAAUL,OAARZ,MAAK,KAAmE,OAAhEY,KAAKmB,GAAG,CAAC,SAACC;uBAAOA,EAAEC,OAAO,CAAC,QAAQ,IAAI,AAAC,IAAK,OAAFD,GAAE,OAAKA;eAAIE,IAAI,CAAC;YAClFlB,QAAQC,GAAG,CAAC,AAAC,GAAkBK,OAAhB3B,QAAQC,IAAI,EAAC,KAAkC,OAA/B0B,QAAQP,MAAM,GAAGS,OAAOT,MAAM,EAAC;YAC9D,IAAIS,OAAOT,MAAM,EAAEC,QAAQC,GAAG,CAAC,AAAC,GAAmBO,OAAjB7B,QAAQE,KAAK,EAAC,KAAiB,OAAd2B,OAAOT,MAAM,EAAC;QACnE;QACAG,IAAAA,aAAI,EAACG,OAAOG,OAAOT,MAAM,GAAGjB,aAAa;IAC3C;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/cli.js"],"sourcesContent":["import exit from 'exit';\nimport getopts from 'getopts-compat';\nimport run from './index.mjs';\n\nconst figures = {\n tick: '✔',\n cross: '✘',\n};\nconst ERROR_CODE = 13;\n\nexport default (argv, name) => {\n const options = getopts(argv.slice(1), {\n alias: { range: 'r', desc: 'd', silent: 's' },\n default: { range: 'major,even' },\n boolean: ['silent', 'desc'],\n stopEarly: true,\n });\n\n // define.option('-r, --range [range]', 'range type of major, minor, or patch with filters of lts, even, odd for version string expressions', 'major,even');\n // define.option('-s, --silent', 'suppress logging', false);\n options.sort = options.desc ? -1 : 1;\n\n const args = argv.slice(0, 1).concat(options._);\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${name} [version expression] [command]`);\n return exit(ERROR_CODE);\n }\n\n options.stdio = 'inherit'; // pass through stdio\n return run(args[0], args[1], args.slice(2), options, (err, results) => {\n if (err && !err.results) {\n console.log(err.message);\n return exit(ERROR_CODE);\n }\n if (err) results = err.results;\n const errors = results.filter((result) => !!result.error);\n\n if (!options.silent) {\n console.log('\\n======================');\n results.forEach((res) => console.log(`${res.error ? figures.cross : figures.tick} ${res.version}${res.error ? ` Error: ${res.error.message}` : ''}`));\n console.log('\\n----------------------');\n console.log(`${name} ${args.map((x) => (x.indexOf(' ') >= 0 ? `\"${x}\"` : x)).join(' ')}`);\n console.log(`${figures.tick} ${results.length - errors.length} succeeded`);\n if (errors.length) console.log(`${figures.cross} ${errors.length} failed`);\n }\n exit(err || errors.length ? ERROR_CODE : 0);\n });\n};\n"],"names":["figures","tick","cross","ERROR_CODE","argv","name","options","getopts","slice","alias","range","desc","silent","default","boolean","stopEarly","sort","args","concat","_","length","console","log","exit","stdio","run","err","results","message","errors","filter","result","error","forEach","res","version","map","x","indexOf","join"],"mappings":";;;;+BAUA;;;eAAA;;;2DAViB;oEACG;4DACJ;;;;;;AAEhB,IAAMA,UAAU;IACdC,MAAM;IACNC,OAAO;AACT;AACA,IAAMC,aAAa;IAEnB,WAAe,SAACC,MAAMC;IACpB,IAAMC,UAAUC,IAAAA,sBAAO,EAACH,KAAKI,KAAK,CAAC,IAAI;QACrCC,OAAO;YAAEC,OAAO;YAAKC,MAAM;YAAKC,QAAQ;QAAI;QAC5CC,SAAS;YAAEH,OAAO;QAAa;QAC/BI,SAAS;YAAC;YAAU;SAAO;QAC3BC,WAAW;IACb;IAEA,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KA;eAAIE,IAAI,CAAC;YAClFlB,QAAQC,GAAG,CAAC,AAAC,GAAkBK,OAAhB3B,QAAQC,IAAI,EAAC,KAAkC,OAA/B0B,QAAQP,MAAM,GAAGS,OAAOT,MAAM,EAAC;YAC9D,IAAIS,OAAOT,MAAM,EAAEC,QAAQC,GAAG,CAAC,AAAC,GAAmBO,OAAjB7B,QAAQE,KAAK,EAAC,KAAiB,OAAd2B,OAAOT,MAAM,EAAC;QACnE;QACAG,IAAAA,aAAI,EAACG,OAAOG,OAAOT,MAAM,GAAGjB,aAAa;IAC3C;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-version-use",
3
- "version": "1.5.32",
3
+ "version": "1.5.34",
4
4
  "description": "Cross-platform solution for using multiple versions of node. Useful for compatibility testing",
5
5
  "keywords": [
6
6
  "node",
@@ -41,7 +41,7 @@
41
41
  "node-version-install": "^1.1.27",
42
42
  "node-version-utils": "^1.2.8",
43
43
  "queue-cb": "^1.4.13",
44
- "spawn-streaming": "^1.0.14"
44
+ "spawn-streaming": "^1.0.15"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/mocha": "*",