@azrico/azcli 1.1.44 → 1.1.45

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.
@@ -1 +1,10 @@
1
- "use strict";var _commons=require("../commons");Object.defineProperty(exports,"__esModule",{value:!0}),exports.update_py=update_py;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function b(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function f(b,d,e,f){var g=d&&d.prototype instanceof k?d:k,h=Object.create(g.prototype),a=new B(f||[]);return E(h,"_invoke",{value:w(b,e,a)}),h}function j(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function k(){}function l(){}function m(){}function q(a){["next","throw","return"].forEach(function(c){b(a,c,function(a){return this._invoke(c,a)})})}function s(b,d){function c(e,f,g,i){var a=j(b[e],b,f);if("throw"!==a.type){var k=a.arg,l=k.value;return l&&"object"==_typeof(l)&&t.call(l,"__await")?d.resolve(l.__await).then(function(a){c("next",a,g,i)},function(a){c("throw",a,g,i)}):d.resolve(l).then(function(a){k.value=a,g(k)},function(a){return c("throw",a,g,i)})}i(a.arg)}var e;E(this,"_invoke",{value:function(a,b){function f(){return new d(function(d,e){c(a,b,d,e)})}return e=e?e.then(f,f):f()}})}function w(a,b,d){var e="suspendedStart";return function(f,g){if(e==="executing")throw Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return{value:D,done:!0}}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var i=x(h,d);if(i){if(i===G)continue;return i}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=j(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===G)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}function x(b,c){var d=c.method,e=b.iterator[d];if(e===D)return c.delegate=null,"throw"===d&&b.iterator["return"]&&(c.method="return",c.arg=D,x(b,c),"throw"===c.method)||"return"!==d&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+d+"' method")),G;var f=j(e,b.iterator,c.arg);if("throw"===f.type)return c.method="throw",c.arg=f.arg,c.delegate=null,G;var g=f.arg;return g?g.done?(c[b.resultName]=g.value,c.next=b.nextLoc,"return"!==c.method&&(c.method="next",c.arg=D),c.delegate=null,G):g:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,G)}function z(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function A(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function B(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(z,this),this.reset(!0)}function C(a){if(a||""===a){var b=a[F];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(t.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=D,b.done=!0,b};return d.next=d}}throw new TypeError(_typeof(a)+" is not iterable")}_regeneratorRuntime=function(){return h};var D,h={},e=Object.prototype,t=e.hasOwnProperty,E=Object.defineProperty||function(a,b,c){a[b]=c.value},n="function"==typeof Symbol?Symbol:{},F=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";try{b({},"")}catch(a){b=function(a,b,c){return a[b]=c}}h.wrap=f;var G={},i={};b(i,F,function(){return this});var o=Object.getPrototypeOf,d=o&&o(o(C([])));d&&d!==e&&t.call(d,F)&&(i=d);var r=m.prototype=k.prototype=Object.create(i);return l.prototype=m,E(r,"constructor",{value:m,configurable:!0}),E(m,"constructor",{value:l,configurable:!0}),l.displayName=b(m,c,"GeneratorFunction"),h.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===l||"GeneratorFunction"===(b.displayName||b.name))},h.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,m):(a.__proto__=m,b(a,c,"GeneratorFunction")),a.prototype=Object.create(r),a},h.awrap=function(a){return{__await:a}},q(s.prototype),b(s.prototype,a,function(){return this}),h.AsyncIterator=s,h.async=function(b,c,d,e,g){void 0===g&&(g=Promise);var j=new s(f(b,c,d,e),g);return h.isGeneratorFunction(c)?j:j.next().then(function(a){return a.done?a.value:j.next()})},q(r),b(r,c,"Generator"),b(r,F,function(){return this}),b(r,"toString",function(){return"[object Generator]"}),h.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function a(){for(;c.length;){var d=c.pop();if(d in b)return a.value=d,a.done=!1,a}return a.done=!0,a}},h.values=C,B.prototype={constructor:B,reset:function(a){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(A),!a)for(var b in this)"t"===b.charAt(0)&&t.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=D)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function(b){function d(a,c){return h.type="throw",h.arg=b,e.next=a,c&&(e.method="next",e.arg=D),!!c}if(this.done)throw b;for(var e=this,f=this.tryEntries.length-1;0<=f;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return d("end");if(g.tryLoc<=this.prev){var j=t.call(g,"catchLoc"),k=t.call(g,"finallyLoc");if(j&&k){if(this.prev<g.catchLoc)return d(g.catchLoc,!0);if(this.prev<g.finallyLoc)return d(g.finallyLoc)}else if(!j){if(!k)throw Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return d(g.finallyLoc)}else if(this.prev<g.catchLoc)return d(g.catchLoc,!0)}}},abrupt:function(b,c){for(var d,e=this.tryEntries.length-1;0<=e;--e)if(d=this.tryEntries[e],d.tryLoc<=this.prev&&t.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var f=d;break}f&&("break"===b||"continue"===b)&&f.tryLoc<=c&&c<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return g.type=b,g.arg=c,f?(this.method="next",this.next=f.finallyLoc,G):this.complete(g)},complete:function(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),G},finish:function(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),A(b),G},catch:function(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var f=d.arg;A(b)}return f}throw Error("illegal catch attempt")},delegateYield:function(a,b,c){return this.delegate={iterator:C(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=D),G}},h}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function update_py(){return _update_py.apply(this,arguments)}function _update_py(){return _update_py=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){return _regeneratorRuntime().wrap(function c(b){for(;1;)switch(b.prev=b.next){case 0:if(!a.nopython){b.next=2;break}return b.abrupt("return");case 2:return(0,_commons.show_msg)("cleaning python cache..."),b.next=5,(0,_commons.do_exec)(["pip3 cache purge"]);case 5:return(0,_commons.show_msg)("installing python packages..."),b.next=8,(0,_commons.do_exec)(["pip3 install -r requirements.txt"]);case 8:(0,_commons.show_msg)("done");case 9:case"end":return b.stop()}},b)})),_update_py.apply(this,arguments)}
1
+ import { do_exec, show_msg } from '../commons';
2
+ export async function update_py(args) {
3
+ if (args.nopython)
4
+ return;
5
+ show_msg(`cleaning python cache...`);
6
+ await do_exec([`pip3 cache purge`]);
7
+ show_msg(`installing python packages...`);
8
+ await do_exec([`pip3 install -r requirements.txt`]);
9
+ show_msg(`done`);
10
+ }
@@ -1,2 +1,78 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.update_yarn=update_yarn;var _nodeChild_process=require("node:child_process"),_commons=require("../commons"),_filterOptionsByAcceptable=_interopRequireDefault(require("./filterOptionsByAcceptable"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function b(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function f(b,d,e,f){var g=d&&d.prototype instanceof k?d:k,h=Object.create(g.prototype),a=new B(f||[]);return E(h,"_invoke",{value:w(b,e,a)}),h}function j(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function k(){}function l(){}function m(){}function q(a){["next","throw","return"].forEach(function(c){b(a,c,function(a){return this._invoke(c,a)})})}function s(b,d){function c(e,f,g,i){var a=j(b[e],b,f);if("throw"!==a.type){var k=a.arg,l=k.value;return l&&"object"==_typeof(l)&&t.call(l,"__await")?d.resolve(l.__await).then(function(a){c("next",a,g,i)},function(a){c("throw",a,g,i)}):d.resolve(l).then(function(a){k.value=a,g(k)},function(a){return c("throw",a,g,i)})}i(a.arg)}var e;E(this,"_invoke",{value:function(a,b){function f(){return new d(function(d,e){c(a,b,d,e)})}return e=e?e.then(f,f):f()}})}function w(a,b,d){var e="suspendedStart";return function(f,g){if(e==="executing")throw Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return{value:D,done:!0}}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var i=x(h,d);if(i){if(i===G)continue;return i}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=j(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===G)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}function x(b,c){var d=c.method,e=b.iterator[d];if(e===D)return c.delegate=null,"throw"===d&&b.iterator["return"]&&(c.method="return",c.arg=D,x(b,c),"throw"===c.method)||"return"!==d&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+d+"' method")),G;var f=j(e,b.iterator,c.arg);if("throw"===f.type)return c.method="throw",c.arg=f.arg,c.delegate=null,G;var g=f.arg;return g?g.done?(c[b.resultName]=g.value,c.next=b.nextLoc,"return"!==c.method&&(c.method="next",c.arg=D),c.delegate=null,G):g:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,G)}function z(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function A(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function B(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(z,this),this.reset(!0)}function C(a){if(a||""===a){var b=a[F];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(t.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=D,b.done=!0,b};return d.next=d}}throw new TypeError(_typeof(a)+" is not iterable")}_regeneratorRuntime=function(){return h};var D,h={},e=Object.prototype,t=e.hasOwnProperty,E=Object.defineProperty||function(a,b,c){a[b]=c.value},n="function"==typeof Symbol?Symbol:{},F=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";try{b({},"")}catch(a){b=function(a,b,c){return a[b]=c}}h.wrap=f;var G={},i={};b(i,F,function(){return this});var o=Object.getPrototypeOf,d=o&&o(o(C([])));d&&d!==e&&t.call(d,F)&&(i=d);var r=m.prototype=k.prototype=Object.create(i);return l.prototype=m,E(r,"constructor",{value:m,configurable:!0}),E(m,"constructor",{value:l,configurable:!0}),l.displayName=b(m,c,"GeneratorFunction"),h.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===l||"GeneratorFunction"===(b.displayName||b.name))},h.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,m):(a.__proto__=m,b(a,c,"GeneratorFunction")),a.prototype=Object.create(r),a},h.awrap=function(a){return{__await:a}},q(s.prototype),b(s.prototype,a,function(){return this}),h.AsyncIterator=s,h.async=function(b,c,d,e,g){void 0===g&&(g=Promise);var j=new s(f(b,c,d,e),g);return h.isGeneratorFunction(c)?j:j.next().then(function(a){return a.done?a.value:j.next()})},q(r),b(r,c,"Generator"),b(r,F,function(){return this}),b(r,"toString",function(){return"[object Generator]"}),h.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function a(){for(;c.length;){var d=c.pop();if(d in b)return a.value=d,a.done=!1,a}return a.done=!0,a}},h.values=C,B.prototype={constructor:B,reset:function(a){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(A),!a)for(var b in this)"t"===b.charAt(0)&&t.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=D)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function(b){function d(a,c){return h.type="throw",h.arg=b,e.next=a,c&&(e.method="next",e.arg=D),!!c}if(this.done)throw b;for(var e=this,f=this.tryEntries.length-1;0<=f;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return d("end");if(g.tryLoc<=this.prev){var j=t.call(g,"catchLoc"),k=t.call(g,"finallyLoc");if(j&&k){if(this.prev<g.catchLoc)return d(g.catchLoc,!0);if(this.prev<g.finallyLoc)return d(g.finallyLoc)}else if(!j){if(!k)throw Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return d(g.finallyLoc)}else if(this.prev<g.catchLoc)return d(g.catchLoc,!0)}}},abrupt:function(b,c){for(var d,e=this.tryEntries.length-1;0<=e;--e)if(d=this.tryEntries[e],d.tryLoc<=this.prev&&t.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var f=d;break}f&&("break"===b||"continue"===b)&&f.tryLoc<=c&&c<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return g.type=b,g.arg=c,f?(this.method="next",this.next=f.finallyLoc,G):this.complete(g)},complete:function(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),G},finish:function(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),A(b),G},catch:function(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var f=d.arg;A(b)}return f}throw Error("illegal catch attempt")},delegateYield:function(a,b,c){return this.delegate={iterator:C(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=D),G}},h}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}/* This lib helps you build a wordpress plugin *///https://github.com/monorepo-template/dependencies/blob/main/packages/yarn-up-skip-workspace/src/utils/filter-options-by-keep-workspace-dependency.ts
2
- var SPAWN_OPTIONS={shell:!0},KEYPRESS_DOWN="\x1B[B",KEYPRESS_ENTER="\n";function update_yarn(){return _update_yarn.apply(this,arguments)}function _update_yarn(){return _update_yarn=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:(0,_commons.show_msg)("updating yarn packages..."),c=Array.isArray(a.target)?a.target:[""],d=/*#__PURE__*/_regeneratorRuntime().mark(function a(){var b;return _regeneratorRuntime().wrap(function d(a){for(;1;)switch(a.prev=a.next){case 0:return b=c[e],a.next=3,new Promise(function(a,c){var d,e=function b(a){if(null===d.stdin)throw new Error("Expected STDIN to exist, but received null.");d.stdin.write(a)},f=function b(a){var c=a.toString(),d=c.split("\n"),f=(0,_filterOptionsByAcceptable["default"])(d),g=d.findIndex(function(a){return(a+"").trim().includes(">")});process.stdout.write(c),1===d.length||0<f&&(f===g?e(KEYPRESS_ENTER):e(KEYPRESS_DOWN))};/* --------------------------------- events --------------------------------- */if((0,_commons.show_msg)("update: ".concat(b)),d=(0,_nodeChild_process.spawn)("yarn",["up","--interactive",b],SPAWN_OPTIONS),d.on("close",a),d.on("error",c),null!==d.stdout)d.stdout.setEncoding("utf8"),d.stdout.on("data",f);else throw"Expected STDOUT to exist, but received null.";if(null!==d.stderr)d.stderr.on("data",_commons.show_error);else throw"Expected STDERR to exist, but received null.";/* -------------------------------------------------------------------------- */});case 3:case"end":return a.stop()}},a)}),e=0;case 4:if(!(e<c.length)){b.next=9;break}return b.delegateYield(d(),"t0",6);case 6:e++,b.next=4;break;case 9:if(process.stdout.write("\n\n"),!a.dedupe){b.next=13;break}return b.next=13,(0,_commons.do_exec)(["yarn dedupe"]);case 13:(0,_commons.show_msg)("yarn update done");case 14:case"end":return b.stop()}},b)})),_update_yarn.apply(this,arguments)}
1
+ /* This lib helps you build a wordpress plugin */
2
+ //https://github.com/monorepo-template/dependencies/blob/main/packages/yarn-up-skip-workspace/src/utils/filter-options-by-keep-workspace-dependency.ts
3
+ import { spawn } from 'node:child_process';
4
+ import { do_exec, show_error, show_msg } from '../commons';
5
+ import findAcceptableIndex from './filterOptionsByAcceptable';
6
+ const SPAWN_OPTIONS = {
7
+ shell: true,
8
+ };
9
+ const KEYPRESS_DOWN = '\u001b[B';
10
+ const KEYPRESS_ENTER = '\n';
11
+ export async function update_yarn(args) {
12
+ show_msg(`updating yarn packages...`);
13
+ const packages = Array.isArray(args.target) ? args.target : [''];
14
+ for (let index = 0; index < packages.length; index++) {
15
+ const pkg_name = packages[index];
16
+ await new Promise((resolve, reject) => {
17
+ let child;
18
+ const write = (chunk) => {
19
+ if (child.stdin === null)
20
+ throw new Error('Expected STDIN to exist, but received null.');
21
+ child.stdin.write(chunk);
22
+ };
23
+ const handleStdOutData = (chunk) => {
24
+ const chunkStr = chunk.toString();
25
+ const options = chunkStr.split('\n');
26
+ const acceptedOption = findAcceptableIndex(options);
27
+ const currentSelectedIndex = options.findIndex((s) => String(s).trim().includes('>'));
28
+ /**
29
+ * the option at index 0 is always the title!
30
+ * so if there are less than 2 options we skip as there is nothing to chose...
31
+ */
32
+ process.stdout.write(chunkStr);
33
+ if (options.length === 1) {
34
+ // show_msg(`-> ${chunkStr}`);
35
+ }
36
+ else if (acceptedOption > 0) {
37
+ // show_msg(
38
+ // `acceptedOption: ${acceptedOption} currentSelectedIndex: ${currentSelectedIndex}`
39
+ // );
40
+ /**
41
+ * there is an option in current line
42
+ * we go down until we reach it
43
+ */
44
+ if (acceptedOption === currentSelectedIndex) {
45
+ // show_msg(`select: ${options[currentSelectedIndex]}`);
46
+ write(KEYPRESS_ENTER);
47
+ }
48
+ else {
49
+ // show_msg(`skip: ${options[currentSelectedIndex]}`);
50
+ write(KEYPRESS_DOWN);
51
+ }
52
+ }
53
+ };
54
+ show_msg(`update: ${pkg_name}`);
55
+ child = spawn('yarn', ['up', '--interactive', pkg_name], SPAWN_OPTIONS);
56
+ child.on('close', resolve);
57
+ child.on('error', reject);
58
+ /* --------------------------------- events --------------------------------- */
59
+ if (child.stdout !== null) {
60
+ child.stdout.setEncoding('utf8');
61
+ child.stdout.on('data', handleStdOutData);
62
+ }
63
+ else
64
+ throw 'Expected STDOUT to exist, but received null.';
65
+ if (child.stderr !== null) {
66
+ child.stderr.on('data', show_error);
67
+ }
68
+ else
69
+ throw 'Expected STDERR to exist, but received null.';
70
+ /* -------------------------------------------------------------------------- */
71
+ });
72
+ }
73
+ process.stdout.write('\n\n');
74
+ if (args.dedupe) {
75
+ await do_exec([`yarn dedupe`]);
76
+ }
77
+ show_msg(`yarn update done`);
78
+ }
@@ -1 +1,8 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _yarnb=_interopRequireDefault(require("./yarnb")),_yarni=_interopRequireDefault(require("./yarni")),_yarnt=_interopRequireDefault(require("./yarnt"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var _default=exports["default"]=[["yarni","YarnInstall",function(){},_yarni["default"]],["yarnb","YarnBuild",function(){},_yarnb["default"]],["yarnt","YarnTest",function(){},_yarnt["default"]]];
1
+ import yarnb from './yarnb';
2
+ import yarni from './yarni';
3
+ import yarnt from './yarnt';
4
+ export default [
5
+ ['yarni', 'YarnInstall', () => { }, yarni],
6
+ ['yarnb', 'YarnBuild', () => { }, yarnb],
7
+ ['yarnt', 'YarnTest', () => { }, yarnt],
8
+ ];
@@ -1 +1,14 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0,exports.handle=handle;var _commons=require("../commons"),cmd1=["yarn run build"];function handle(a){(0,_commons.show_msg)("YarnBuild","text");var b=a.q?void 0:console.log;return(0,_commons.do_exec)(cmd1,b)["finally"](function(){(0,_commons.show_msg)("YarnBuild done","text")})["catch"](function(){(0,_commons.err_unknown)("YarnBuild failed")})}var _default=exports["default"]=handle;
1
+ import { do_exec, err_unknown, show_msg } from '../commons';
2
+ const cmd1 = ['yarn run build'];
3
+ export function handle(args) {
4
+ show_msg('YarnBuild', 'text');
5
+ const fhandler = args.q ? undefined : console.log;
6
+ return do_exec(cmd1, fhandler)
7
+ .finally(() => {
8
+ show_msg('YarnBuild done', 'text');
9
+ })
10
+ .catch(() => {
11
+ err_unknown('YarnBuild failed');
12
+ });
13
+ }
14
+ export default handle;
@@ -1 +1,14 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0,exports.handle=handle;var _commons=require("../commons"),cmd1=["yarn install"];function handle(a){(0,_commons.show_msg)("YarnInstall","text");var b=a.q?void 0:console.log;return(0,_commons.do_exec)(cmd1,b)["finally"](function(){(0,_commons.show_msg)("YarnInstall done","text")})["catch"](function(){(0,_commons.err_unknown)("YarnInstall failed")})}var _default=exports["default"]=handle;
1
+ import { do_exec, err_unknown, show_msg } from '../commons';
2
+ const cmd1 = ['yarn install'];
3
+ export function handle(args) {
4
+ show_msg('YarnInstall', 'text');
5
+ const fhandler = args.q ? undefined : console.log;
6
+ return do_exec(cmd1, fhandler)
7
+ .finally(() => {
8
+ show_msg('YarnInstall done', 'text');
9
+ })
10
+ .catch(() => {
11
+ err_unknown('YarnInstall failed');
12
+ });
13
+ }
14
+ export default handle;
@@ -1 +1,14 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0,exports.handle=handle;var _commons=require("../commons"),cmd1=["yarn run test"];function handle(a){(0,_commons.show_msg)("YarnTest","text");var b=a.q?void 0:console.log;return(0,_commons.do_exec)(cmd1,b)["finally"](function(){(0,_commons.show_msg)("YarnTest done","text")})["catch"](function(){(0,_commons.err_unknown)("YarnTest failed")})}var _default=exports["default"]=handle;
1
+ import { do_exec, err_unknown, show_msg } from '../commons';
2
+ const cmd1 = ['yarn run test'];
3
+ export function handle(args) {
4
+ show_msg('YarnTest', 'text');
5
+ const fhandler = args.q ? undefined : console.log;
6
+ return do_exec(cmd1, fhandler)
7
+ .finally(() => {
8
+ show_msg('YarnTest done', 'text');
9
+ })
10
+ .catch(() => {
11
+ err_unknown('YarnTest failed');
12
+ });
13
+ }
14
+ export default handle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/azcli",
3
- "version": "1.1.44",
3
+ "version": "1.1.45",
4
4
  "description": "",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cli.js",