Socket
Socket
Sign inDemoInstall

git-wiz

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-wiz - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

2

bin/index.js
#!/usr/bin/env node
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=require("commander")},function(t,e){t.exports=require("inquirer")},function(t,e){t.exports=require("child_process")},function(t){t.exports=JSON.parse('{"a":"1.3.0"}')},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n(1),i=n.n(o),u=function(){return(u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},c=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r};function l(t,e){return a(this,void 0,void 0,(function(){return c(this,(function(n){switch(n.label){case 0:return[4,f(t,e,{})];case 1:return[2,n.sent().files]}}))}))}function f(t,e,n){return a(this,void 0,void 0,(function(){var r;return c(this,(function(o){return r=Object.entries(n).map((function(t){var e=t[0],n=t[1];return u({name:e},n)})),[2,i.a.prompt(s([{type:"checkbox",name:"files",message:t,choices:e,validate:function(t){return!(t.length<1)||"Are you tricking me 🤨? Please choose files"}}],r))]}))}))}var h=n(2);function p(t,e){return void 0===e&&(e=!1),new Promise((function(n,r){try{n(Object(h.spawnSync)("git",t.split(" "),{cwd:process.cwd(),stdio:e?"inherit":"pipe",encoding:"utf8"}).stdout)}catch(t){r(t)}}))}var d=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},v=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},g=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r};function y(t,e,n,r){return void 0===r&&(r=!1),d(this,void 0,void 0,(function(){var o;return v(this,(function(i){switch(i.label){case 0:return[4,p(o=t+" "+g(n||[],e).join(" "),r)];case 1:return i.sent(),r?[2]:(console.log("",'"git '+o+'"',"","did great 🤟"),[2])}}))}))}function b(){return d(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,p("status --porcelain=v2 -uall")];case 1:return t=e.sent(),[2,t.split(/\n/g).filter((function(t){return t})).reduce((function(t,e){try{var n=e.split(/ +/g),r=n[0],o=n.slice(1),i=o[o.length-1];if("1"===r){var u=o[0].split(""),a=u[0],c=u[1];"."!==a&&t.push({status:"staged",path:i,deleted:"D"===a}),"."!==c&&t.push({status:"tracked",path:i,deleted:"D"===c})}else"?"===r&&t.push({status:"untracked",path:i})}catch(t){console.log(e)}return t}),[])]}}))}))}function w(t){return d(this,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return[4,y("add",t)];case 1:return e.sent(),[2]}}))}))}function m(t){return d(this,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return[4,y("reset HEAD --",t)];case 1:return e.sent(),[2]}}))}))}function x(t,e){return d(this,void 0,void 0,(function(){return v(this,(function(n){switch(n.label){case 0:return[4,w(t)];case 1:return n.sent(),[4,y("stash push"+(e?" -m "+e.replace(/ /g,"-"):""),t)];case 2:return n.sent(),[2]}}))}))}function k(t,e){return y("diff",t,e,!0)}var O=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},S=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},j=A((function(){return O(void 0,void 0,void 0,(function(){var t;return S(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return(t=e.sent().filter((function(t){return"staged"!==t.status}))).length?[4,l("Files to add",t.map((function(t){return t.path})))]:(console.log("","There are no changes here. Get back to work 🤓"),[2]);case 2:return[4,w(e.sent())];case 3:return e.sent(),[2]}}))}))})),P=A((function(){return O(void 0,void 0,void 0,(function(){var t;return S(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return(t=e.sent().filter((function(t){return"staged"===t.status}))).length?[4,l("Files to reset?",t.map((function(t){return t.path})))]:(console.log("","There are no files in stage. You have nothing to regret about 🦾"),[2]);case 2:return[4,m(e.sent())];case 3:return e.sent(),[2]}}))}))})),T=A((function(){return O(void 0,void 0,void 0,(function(){var t,e,n,r;return S(this,(function(o){switch(o.label){case 0:return[4,b()];case 1:return(t=o.sent().filter((function(t){return!t.deleted}))).length?[4,f("Files to stash",t.map((function(t){return t.path})),{message:{type:"input",message:'Leave a message to your future self ("-m").. or not, whatever'}})]:(console.log("","Stash what exactly 🤥?"),[2]);case 2:return e=o.sent(),n=e.files,r=e.message,[4,x(n,r)];case 3:return o.sent(),[2]}}))}))})),_=A((function(t){return O(void 0,void 0,void 0,(function(){var e,n;return S(this,(function(r){switch(r.label){case 0:return e=t.args.includes("--cached"),[4,b()];case 1:return(n=r.sent().filter((function(t){return!t.deleted&&(e?"staged"===t.status:"staged"!==t.status)}))).length?[4,l("Files to diff",n.map((function(t){return t.path})))]:(console.log("","You can't view diff of.. nothing 🧐"),[2]);case 2:return[4,k(r.sent(),t.args)];case 3:return r.sent(),[2]}}))}))}));function A(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return t.apply(void 0,e)}catch(t){console.log("","Oops, something went wrong",t)}}}var q=n(3);!function(){try{r.program.version(q.a),r.program.command("add").description('do "git add" with style 📥').action(j),r.program.command("reset").description('do "git reset" with style 🔙').action(P),r.program.command("stash").description('do "git stash" with style 👜').action(T),r.program.command("diff").allowUnknownOption().description('do "git diff" with style 🤔 (Accept any argument "git diff" accpets)').action(_),r.program.parse(process.argv)}catch(t){console.log(t)}}()}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports=require("commander")},function(t,e){t.exports=require("inquirer")},function(t,e){t.exports=require("child_process")},function(t,e){t.exports=require("path")},function(t){t.exports=JSON.parse('{"a":"1.4.0"}')},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n(1),i=n.n(o),u=function(){return(u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},c=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r};function l(t,e){return a(this,void 0,void 0,(function(){return c(this,(function(n){switch(n.label){case 0:return[4,f(t,e,{})];case 1:return[2,n.sent().files]}}))}))}function f(t,e,n){return a(this,void 0,void 0,(function(){var r;return c(this,(function(o){return r=Object.entries(n).map((function(t){var e=t[0],n=t[1];return u({name:e},n)})),[2,i.a.prompt(s([{type:"checkbox",name:"files",message:t,choices:e,validate:function(t){return!(t.length<1)||"Are you tricking me 🤨? Please choose files"}}],r))]}))}))}var h=n(2);function p(t,e){return void 0===e&&(e=!1),new Promise((function(n,r){try{n(Object(h.spawnSync)("git",t.split(" "),{cwd:process.cwd(),stdio:e?"inherit":"pipe",encoding:"utf8"}).stdout)}catch(t){r(t)}}))}var d=n(3),v=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},g=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},y=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r};function b(t,e,n,r){return void 0===r&&(r=!1),v(this,void 0,void 0,(function(){var o;return g(this,(function(i){switch(i.label){case 0:return[4,p(o=t+" "+y(n||[],e).join(" "),r)];case 1:return i.sent(),r?[2]:(console.log("",'"git '+o+'"',"","did great 🤟"),[2])}}))}))}function m(){return v(this,void 0,void 0,(function(){var t;return g(this,(function(e){switch(e.label){case 0:return[4,p("status --porcelain=v2 -uall")];case 1:return t=e.sent(),[2,t.split(/\n/g).filter((function(t){return t})).reduce((function(t,e){try{var n=e.split(/ +/g),r=n[0],o=n.slice(1),i=o[o.length-1];if("1"===r){var u=o[0].split(""),a=u[0],c=u[1];"."!==a&&t.push({status:"staged",path:i,deleted:"D"===a}),"."!==c&&t.push({status:"tracked",path:i,deleted:"D"===c})}else"?"===r&&t.push({status:"untracked",path:i})}catch(t){console.log(e)}return t}),[])]}}))}))}function w(t){return v(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,b("add",t)];case 1:return e.sent(),[2]}}))}))}function x(t){return v(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,b("reset HEAD --",t)];case 1:return e.sent(),[2]}}))}))}function k(t,e){return v(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return[4,w(t)];case 1:return n.sent(),[4,b("stash push"+(e?" -m "+e.replace(/ /g,"-"):""),t)];case 2:return n.sent(),[2]}}))}))}function O(t,e){return b("diff",t,e,!0)}function S(t,e){var n=t.replace(Object(d.basename)(t),e);return b("mv",[],[t,n])}var j=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},P=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},T=F((function(){return j(void 0,void 0,void 0,(function(){var t;return P(this,(function(e){switch(e.label){case 0:return[4,m()];case 1:return(t=e.sent().filter((function(t){return"staged"!==t.status}))).length?[4,l("Files to add",t.map((function(t){return t.path})))]:(console.log("","There are no changes here. Get back to work 🤓"),[2]);case 2:return[4,w(e.sent())];case 3:return e.sent(),[2]}}))}))})),_=F((function(){return j(void 0,void 0,void 0,(function(){var t;return P(this,(function(e){switch(e.label){case 0:return[4,m()];case 1:return(t=e.sent().filter((function(t){return"staged"===t.status}))).length?[4,l("Files to reset?",t.map((function(t){return t.path})))]:(console.log("","There are no files in stage. You have nothing to regret about 🦾"),[2]);case 2:return[4,x(e.sent())];case 3:return e.sent(),[2]}}))}))})),q=F((function(){return j(void 0,void 0,void 0,(function(){var t,e,n,r;return P(this,(function(o){switch(o.label){case 0:return[4,m()];case 1:return(t=o.sent().filter((function(t){return!t.deleted}))).length?[4,f("Files to stash",t.map((function(t){return t.path})),{message:{type:"input",message:'Leave a message to your future self ("-m").. or not, whatever'}})]:(console.log("","Stash what exactly 🤥?"),[2]);case 2:return e=o.sent(),n=e.files,r=e.message,[4,k(n,r)];case 3:return o.sent(),[2]}}))}))})),A=F((function(t){return j(void 0,void 0,void 0,(function(){var e,n;return P(this,(function(r){switch(r.label){case 0:return e=t.args.includes("--cached"),[4,m()];case 1:return(n=r.sent().filter((function(t){return!t.deleted&&(e?"staged"===t.status:"staged"!==t.status)}))).length?[4,l("Files to diff",n.map((function(t){return t.path})))]:(console.log("","You can't view diff of.. nothing 🧐"),[2]);case 2:return[4,O(r.sent(),t.args)];case 3:return r.sent(),[2]}}))}))})),E=F((function(t){var e=t.args,n=e[0],r=e[1];return j(void 0,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return[4,S(n,r)];case 1:return t.sent(),[2]}}))}))}));function F(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return t.apply(void 0,e)}catch(t){console.log("","Oops, something went wrong",t)}}}var G=n(4);!function(){try{r.program.version(G.a),r.program.command("add").description('do "git add" with style 📥').action(T),r.program.command("reset").description('do "git reset" with style 🔙').action(_),r.program.command("stash").description('do "git stash" with style 👜').action(q),r.program.command("diff").allowUnknownOption().description('do "git diff" with style 🤔 (Accept any argument "git diff" accpets)').action(A),r.program.command("rename <path> <newName>").description('do "git mv" (for renaming) with style 🔖').action(E),r.program.parse(process.argv)}catch(t){console.log(t)}}()}]);
## Change log
**0.2.0**
**1.4.0**
- Support command `rename`
**1.3.0**
- Nothing, I'm not sure why it was a major 🤨
**1.2.0**
- Support commands `stash` and `diff` (also added webpack + typescript)
**0.1.0**
**1.1.0**
- Support commands `add` and `reset`
{
"name": "git-wiz",
"version": "1.3.0",
"version": "1.4.0",
"author": {

@@ -34,5 +34,3 @@ "email": "moshfeu.dev@gmail.com",

"commander": "^6.1.0",
"inquirer": "^7.3.3",
"ts-loader": "^8.0.3",
"typescript": "^4.0.2"
"inquirer": "^7.3.3"
},

@@ -44,4 +42,6 @@ "devDependencies": {

"webpack-cli": "^3.3.12",
"webpack-node-externals": "^2.5.2"
"webpack-node-externals": "^2.5.2",
"ts-loader": "^8.0.3",
"typescript": "^4.0.2"
}
}

@@ -34,2 +34,3 @@ ![thanks for stopping by](https://moshfeudev.wixsite.com/shield/_functions/view/git-wiz)

- `diff`
- `rename` (`mv`)

@@ -36,0 +37,0 @@ ## Development

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc