(()=>{"use strict";var e={919:e=>{function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function o(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,n){n||(n={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof n.unknown&&(r.unknownFn=n.unknown),"boolean"==typeof n.boolean&&n.boolean?r.allBools=!0:[].concat(n.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var s={};function i(e){return s[e].some((function(e){return r.bools[e]}))}Object.keys(n.alias||{}).forEach((function(e){s[e]=[].concat(n.alias[e]),s[e].forEach((function(t){s[t]=[e].concat(s[e].filter((function(e){return t!==e})))}))})),[].concat(n.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,s[e]&&[].concat(s[e]).forEach((function(e){r.strings[e]=!0}))}));var c=n.default||{},l={_:[]};function a(e,t,n){for(var s=e,i=0;i<t.length-1;i++){var c=t[i];if(o(s,c))return;void 0===s[c]&&(s[c]={}),s[c]!==Object.prototype&&s[c]!==Number.prototype&&s[c]!==String.prototype||(s[c]={}),s[c]===Array.prototype&&(s[c]=[]),s=s[c]}var l=t[t.length-1];o(s,l)||(s!==Object.prototype&&s!==Number.prototype&&s!==String.prototype||(s={}),s===Array.prototype&&(s=[]),void 0===s[l]||r.bools[l]||"boolean"==typeof s[l]?s[l]=n:Array.isArray(s[l])?s[l].push(n):s[l]=[s[l],n])}function u(e,o,n){if(!n||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||s[e]}(e,n)||!1!==r.unknownFn(n)){var i=!r.strings[e]&&t(o)?Number(o):o;a(l,e.split("."),i),(s[e]||[]).forEach((function(e){a(l,e.split("."),i)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==c[e]&&c[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,b,d=e[p];if(/^--.+=/.test(d)){var v=d.match(/^--([^=]+)=([\s\S]*)$/);h=v[1];var y=v[2];r.bools[h]&&(y="false"!==y),u(h,y,d)}else if(/^--no-.+/.test(d))u(h=d.match(/^--no-(.+)/)[1],!1,d);else if(/^--.+/.test(d))h=d.match(/^--(.+)/)[1],void 0===(b=e[p+1])||/^(-|--)[^-]/.test(b)||r.bools[h]||r.allBools||s[h]&&i(h)?/^(true|false)$/.test(b)?(u(h,"true"===b,d),p+=1):u(h,!r.strings[h]||"",d):(u(h,b,d),p+=1);else if(/^-[^-]+/.test(d)){for(var g=d.slice(1,-1).split(""),_=!1,k=0;k<g.length;k++)if("-"!==(b=d.slice(k+2))){if(/[A-Za-z]/.test(g[k])&&"="===b[0]){u(g[k],b.slice(1),d),_=!0;break}if(/[A-Za-z]/.test(g[k])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(b)){u(g[k],b,d),_=!0;break}if(g[k+1]&&g[k+1].match(/\W/)){u(g[k],d.slice(k+2),d),_=!0;break}u(g[k],!r.strings[g[k]]||"",d)}else u(g[k],b,d);h=d.slice(-1)[0],_||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||s[h]&&i(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],d),p+=1):u(h,!r.strings[h]||"",d):(u(h,e[p+1],d),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(d)||l._.push(r.strings._||!t(d)?d:Number(d)),n.stopEarly){l._.push.apply(l._,e.slice(p+1));break}}return Object.keys(c).forEach((function(e){var t,o,n;t=l,o=e.split("."),n=t,o.slice(0,-1).forEach((function(e){n=n[e]||{}})),o[o.length-1]in n||(a(l,e.split("."),c[e]),(s[e]||[]).forEach((function(t){a(l,t.split("."),c[e])})))})),n["--"]?l["--"]=f.slice():f.forEach((function(e){l._.push(e)})),l}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=require("path");var r=o(919),s=o.n(r);const i=require("child_process"),c=(...e)=>{{const t="github-desktop";(0,i.execFile)((0,n.join)(__dirname,`../../${t}`),e,(function(t,o){t&&(console.error(`Error running command ${e}`),console.error(o),process.exit(t.code))}))}},l=s()(process.argv.slice(2),{alias:{help:"h",branch:"b"},boolean:["help"]}),a=(e=1)=>{process.stderr.write("GitHub Desktop CLI usage: \n  github                            Open the current directory\n  github open [path]                Open the provided path\n  github clone [-b branch] <url>    Clone the repository by url or name/owner\n                                    (ex torvalds/linux), optionally checking out\n                                    the branch\n"),process.exit(e)};if(delete process.env.ELECTRON_RUN_AS_NODE,l.help||"help"===l._.at(0))a(0);else if("clone"===l._.at(0)){const e=l._.at(1),t=e&&/^[^\/]+\/[^\/]+$/.test(e)?`https://github.com/${e}`:e;t?"string"==typeof l.branch?c(`--cli-clone=${t}`,`--cli-branch=${l.branch}`):c(`--cli-clone=${t}`):a(1)}else{const[e,t]=l._,o="open"===e?t:e;c(`--cli-open=${(0,n.resolve)(o??".")}`)}module.exports.cli={}})();
//# sourceMappingURL=cli.js.map