@modernpoacher/deps 1.5.7 → 1.5.8

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/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.executeBundle=executeBundle;exports.executeDev=executeDev;exports.executeOptional=executeOptional;exports.executeProd=executeProd;exports.getInstallCommands=void 0;exports.getInstallSaveBundleCommands=getInstallSaveBundleCommands;exports.getInstallSaveBundleSaveExactCommands=getInstallSaveBundleSaveExactCommands;exports.getInstallSaveDevCommands=getInstallSaveDevCommands;exports.getInstallSaveDevSaveExactCommands=getInstallSaveDevSaveExactCommands;exports.getInstallSaveExactCommands=void 0;exports.getInstallSaveOptionalCommands=getInstallSaveOptionalCommands;exports.getInstallSaveOptionalSaveExactCommands=getInstallSaveOptionalSaveExactCommands;exports.getInstallSaveProdCommands=getInstallSaveProdCommands;exports.getInstallSaveProdSaveExactCommands=getInstallSaveProdSaveExactCommands;exports.installSaveBundle=installSaveBundle;exports.installSaveBundleSaveExact=installSaveBundleSaveExact;exports.installSaveDev=installSaveDev;exports.installSaveDevSaveExact=installSaveDevSaveExact;exports.installSaveOptional=installSaveOptional;exports.installSaveOptionalSaveExact=installSaveOptionalSaveExact;exports.installSaveProd=installSaveProd;exports.installSaveProdSaveExact=installSaveProdSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("./common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps');log(`\`deps\` (${_os.platform}) is awake`);function use(key){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function use(v){const s=v.trim();if(s==='')return;return log(s);};}const getInstallSaveExactCommands=(p,r,f)=>{log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,r,f)=>{log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands)));};exports.getInstallCommands=getInstallCommands;function getInstallSaveBundleSaveExactCommands(p,r,f){log('getInstallSaveBundleSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveBundleCommands(p,r,f){log('getInstallSaveBundleCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveOptionalSaveExactCommands(p,r,f){log('getInstallSaveOptionalSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveOptionalCommands(p,r,f){log('getInstallSaveOptionalCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveDevSaveExactCommands(p,r,f){log('getInstallSaveDevSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveDevCommands(p,r,f){log('getInstallSaveDevCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveProdSaveExactCommands(p,r,f){log('getInstallSaveProdSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function getInstallSaveProdCommands(p,r,f){log('getInstallSaveProdCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function installSaveBundleSaveExact(d,p,r,f){log('installSaveBundleSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-bundle-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveBundleSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveBundle(d,p,r,f){log('installSaveBundle');return new Promise((resolve,reject)=>{const log=use('install-save-bundle');const commands=(0,_common.getCommands)(d,getInstallSaveBundleCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveOptionalSaveExact(d,p,r,f){log('installSaveOptionalSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-otional-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveOptional(d,p,r,f){log('installSaveOptional');return new Promise((resolve,reject)=>{const log=use('install-save-otional');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveDevSaveExact(d,p,r,f){log('installSaveDevSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-dev-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveDevSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveDev(d,p,r,f){log('installSaveDev');return new Promise((resolve,reject)=>{const log=use('install-save-dev');const commands=(0,_common.getCommands)(d,getInstallSaveDevCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveProdSaveExact(d,p,r,f){log('installSaveProdSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-prod-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveProdSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveProd(d,p,r,f){log('installSaveProd');return new Promise((resolve,reject)=>{const log=use('install-save-prod');const commands=(0,_common.getCommands)(d,getInstallSaveProdCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}async function executeBundle(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeBundle');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveBundleSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveBundle(directory,deps,registry,force);}async function executeOptional(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeOptional');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveOptionalSaveExact(directory,depsExact,registry);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveOptional(directory,deps,registry);}async function executeDev(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeDev');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveDevSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveDev(directory,deps,registry,force);}async function executeProd(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeProd');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveProdSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveProd(directory,deps,registry,force);}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.executeBundle=executeBundle;exports.executeDev=executeDev;exports.executeOptional=executeOptional;exports.executeProd=executeProd;exports.getInstallCommands=void 0;exports.getInstallSaveBundleCommands=getInstallSaveBundleCommands;exports.getInstallSaveBundleSaveExactCommands=getInstallSaveBundleSaveExactCommands;exports.getInstallSaveDevCommands=getInstallSaveDevCommands;exports.getInstallSaveDevSaveExactCommands=getInstallSaveDevSaveExactCommands;exports.getInstallSaveExactCommands=void 0;exports.getInstallSaveOptionalCommands=getInstallSaveOptionalCommands;exports.getInstallSaveOptionalSaveExactCommands=getInstallSaveOptionalSaveExactCommands;exports.getInstallSaveProdCommands=getInstallSaveProdCommands;exports.getInstallSaveProdSaveExactCommands=getInstallSaveProdSaveExactCommands;exports.installSaveBundle=installSaveBundle;exports.installSaveBundleSaveExact=installSaveBundleSaveExact;exports.installSaveDev=installSaveDev;exports.installSaveDevSaveExact=installSaveDevSaveExact;exports.installSaveOptional=installSaveOptional;exports.installSaveOptionalSaveExact=installSaveOptionalSaveExact;exports.installSaveProd=installSaveProd;exports.installSaveProdSaveExact=installSaveProdSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("./common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps');log(`\`deps\` (${_os.platform}) is awake`);function use(key){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function use(v){const s=v.trim();if(s==='')return;return log(s);};}const getInstallSaveExactCommands=(p,r,f)=>{log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,r,f)=>{log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands)));};exports.getInstallCommands=getInstallCommands;function getInstallSaveBundleSaveExactCommands(p,r,f){log('getInstallSaveBundleSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveBundleCommands(p,r,f){log('getInstallSaveBundleCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveOptionalSaveExactCommands(p,r,f){log('getInstallSaveOptionalSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveOptionalCommands(p,r,f){log('getInstallSaveOptionalCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveDevSaveExactCommands(p,r,f){log('getInstallSaveDevSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveDevCommands(p,r,f){log('getInstallSaveDevCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveProdSaveExactCommands(p,r,f){log('getInstallSaveProdSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function getInstallSaveProdCommands(p,r,f){log('getInstallSaveProdCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function installSaveBundleSaveExact(d,p,r,f){log('installSaveBundleSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-bundle-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveBundleSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveBundle(d,p,r,f){log('installSaveBundle');return new Promise((resolve,reject)=>{const log=use('install-save-bundle');const commands=(0,_common.getCommands)(d,getInstallSaveBundleCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveOptionalSaveExact(d,p,r,f){log('installSaveOptionalSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-otional-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveOptional(d,p,r,f){log('installSaveOptional');return new Promise((resolve,reject)=>{const log=use('install-save-otional');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveDevSaveExact(d,p,r,f){log('installSaveDevSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-dev-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveDevSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveDev(d,p,r,f){log('installSaveDev');return new Promise((resolve,reject)=>{const log=use('install-save-dev');const commands=(0,_common.getCommands)(d,getInstallSaveDevCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveProdSaveExact(d,p,r,f){log('installSaveProdSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-prod-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveProdSaveExactCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function installSaveProd(d,p,r,f){log('installSaveProd');return new Promise((resolve,reject)=>{const log=use('install-save-prod');const commands=(0,_common.getCommands)(d,getInstallSaveProdCommands(p,r,f));log(commands);(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}async function executeBundle(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeBundle');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveBundleSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveBundle(directory,deps,registry,force);}async function executeOptional(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeOptional');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveOptionalSaveExact(directory,depsExact,registry);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveOptional(directory,deps,registry);}async function executeDev(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeDev');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveDevSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveDev(directory,deps,registry,force);}async function executeProd(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeProd');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveProdSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveProd(directory,deps,registry,force);}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.execute=execute;exports.getInstallSaveExactCommands=exports.getInstallCommands=void 0;exports.install=install;exports.installSaveExact=installSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("../common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps:install');log(`\`install\` (${_os.platform}) is awake`);const getInstallSaveExactCommands=(p,s,r,f)=>{log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands)))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,s,r,f)=>{log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands))));};exports.getInstallCommands=getInstallCommands;function installSaveExact(d,p,s,r,f){log('installSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveExactCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function install(d,p,s,r,f){log('install');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}async function execute(directory=_common.DIRECTORY,packages={},configuration={},save=false,registry=_common.REGISTRY,force=false){log('execute');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveExact(directory,depsExact,save,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await install(directory,deps,save,registry,force);}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.execute=execute;exports.getInstallSaveExactCommands=exports.getInstallCommands=void 0;exports.install=install;exports.installSaveExact=installSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("../common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps:install');log(`\`install\` (${_os.platform}) is awake`);const getInstallSaveExactCommands=(p,s,r,f)=>{log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands)))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,s,r,f)=>{log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands))));};exports.getInstallCommands=getInstallCommands;function installSaveExact(d,p,s,r,f){log('installSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveExactCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}function install(d,p,s,r,f){log('install');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},function handleComplete(e){if(e){log(e);return reject(e);}return resolve();}).on('close',resolve).on('error',function handleError(e){log(e);reject(e);});});}async function execute(directory=_common.DIRECTORY,packages={},configuration={},save=false,registry=_common.REGISTRY,force=false){log('execute');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveExact(directory,depsExact,save,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await install(directory,deps,save,registry,force);}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
package/src/index.js CHANGED
@@ -277,9 +277,25 @@ export function installSaveBundleSaveExact (d, p, r, f) {
277
277
 
278
278
  log(commands)
279
279
 
280
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
280
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
281
+ if (e) {
282
+ log(e)
283
+
284
+ return (
285
+ reject(e)
286
+ )
287
+ }
288
+
289
+ return (
290
+ resolve()
291
+ )
292
+ })
281
293
  .on('close', resolve)
282
- .on('error', reject)
294
+ .on('error', function handleError (e) {
295
+ log(e)
296
+
297
+ reject(e)
298
+ })
283
299
  })
284
300
  )
285
301
  }
@@ -306,9 +322,25 @@ export function installSaveBundle (d, p, r, f) {
306
322
 
307
323
  log(commands)
308
324
 
309
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
325
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
326
+ if (e) {
327
+ log(e)
328
+
329
+ return (
330
+ reject(e)
331
+ )
332
+ }
333
+
334
+ return (
335
+ resolve()
336
+ )
337
+ })
310
338
  .on('close', resolve)
311
- .on('error', reject)
339
+ .on('error', function handleError (e) {
340
+ log(e)
341
+
342
+ reject(e)
343
+ })
312
344
  })
313
345
  )
314
346
  }
@@ -335,9 +367,25 @@ export function installSaveOptionalSaveExact (d, p, r, f) {
335
367
 
336
368
  log(commands)
337
369
 
338
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
370
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
371
+ if (e) {
372
+ log(e)
373
+
374
+ return (
375
+ reject(e)
376
+ )
377
+ }
378
+
379
+ return (
380
+ resolve()
381
+ )
382
+ })
339
383
  .on('close', resolve)
340
- .on('error', reject)
384
+ .on('error', function handleError (e) {
385
+ log(e)
386
+
387
+ reject(e)
388
+ })
341
389
  })
342
390
  )
343
391
  }
@@ -364,9 +412,25 @@ export function installSaveOptional (d, p, r, f) {
364
412
 
365
413
  log(commands)
366
414
 
367
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
415
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
416
+ if (e) {
417
+ log(e)
418
+
419
+ return (
420
+ reject(e)
421
+ )
422
+ }
423
+
424
+ return (
425
+ resolve()
426
+ )
427
+ })
368
428
  .on('close', resolve)
369
- .on('error', reject)
429
+ .on('error', function handleError (e) {
430
+ log(e)
431
+
432
+ reject(e)
433
+ })
370
434
  })
371
435
  )
372
436
  }
@@ -393,9 +457,25 @@ export function installSaveDevSaveExact (d, p, r, f) {
393
457
 
394
458
  log(commands)
395
459
 
396
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
460
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
461
+ if (e) {
462
+ log(e)
463
+
464
+ return (
465
+ reject(e)
466
+ )
467
+ }
468
+
469
+ return (
470
+ resolve()
471
+ )
472
+ })
397
473
  .on('close', resolve)
398
- .on('error', reject)
474
+ .on('error', function handleError (e) {
475
+ log(e)
476
+
477
+ reject(e)
478
+ })
399
479
  })
400
480
  )
401
481
  }
@@ -422,9 +502,25 @@ export function installSaveDev (d, p, r, f) {
422
502
 
423
503
  log(commands)
424
504
 
425
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
505
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
506
+ if (e) {
507
+ log(e)
508
+
509
+ return (
510
+ reject(e)
511
+ )
512
+ }
513
+
514
+ return (
515
+ resolve()
516
+ )
517
+ })
426
518
  .on('close', resolve)
427
- .on('error', reject)
519
+ .on('error', function handleError (e) {
520
+ log(e)
521
+
522
+ reject(e)
523
+ })
428
524
  })
429
525
  )
430
526
  }
@@ -451,9 +547,25 @@ export function installSaveProdSaveExact (d, p, r, f) {
451
547
 
452
548
  log(commands)
453
549
 
454
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
550
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
551
+ if (e) {
552
+ log(e)
553
+
554
+ return (
555
+ reject(e)
556
+ )
557
+ }
558
+
559
+ return (
560
+ resolve()
561
+ )
562
+ })
455
563
  .on('close', resolve)
456
- .on('error', reject)
564
+ .on('error', function handleError (e) {
565
+ log(e)
566
+
567
+ reject(e)
568
+ })
457
569
  })
458
570
  )
459
571
  }
@@ -480,9 +592,25 @@ export function installSaveProd (d, p, r, f) {
480
592
 
481
593
  log(commands)
482
594
 
483
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
595
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
596
+ if (e) {
597
+ log(e)
598
+
599
+ return (
600
+ reject(e)
601
+ )
602
+ }
603
+
604
+ return (
605
+ resolve()
606
+ )
607
+ })
484
608
  .on('close', resolve)
485
- .on('error', reject)
609
+ .on('error', function handleError (e) {
610
+ log(e)
611
+
612
+ reject(e)
613
+ })
486
614
  })
487
615
  )
488
616
  }
@@ -92,9 +92,25 @@ export function installSaveExact (d, p, s, r, f) {
92
92
  new Promise((resolve, reject) => {
93
93
  const commands = getCommands(d, getInstallSaveExactCommands(p, s, r, f))
94
94
 
95
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
95
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
96
+ if (e) {
97
+ log(e)
98
+
99
+ return (
100
+ reject(e)
101
+ )
102
+ }
103
+
104
+ return (
105
+ resolve()
106
+ )
107
+ })
96
108
  .on('close', resolve)
97
- .on('error', reject)
109
+ .on('error', function handleError (e) {
110
+ log(e)
111
+
112
+ reject(e)
113
+ })
98
114
  })
99
115
  )
100
116
  }
@@ -119,9 +135,25 @@ export function install (d, p, s, r, f) {
119
135
  new Promise((resolve, reject) => {
120
136
  const commands = getCommands(d, getInstallCommands(p, s, r, f))
121
137
 
122
- spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, (e) => (!e) ? resolve() : reject(e))
138
+ spawn('/bin/bash', ['-c', commands], { shell: true, stdio: 'inherit' }, function handleComplete (e) {
139
+ if (e) {
140
+ log(e)
141
+
142
+ return (
143
+ reject(e)
144
+ )
145
+ }
146
+
147
+ return (
148
+ resolve()
149
+ )
150
+ })
123
151
  .on('close', resolve)
124
- .on('error', reject)
152
+ .on('error', function handleError (e) {
153
+ log(e)
154
+
155
+ reject(e)
156
+ })
125
157
  })
126
158
  )
127
159
  }