Skip to content

Commit

Permalink
Bump binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Feb 12, 2021
1 parent 4975aa9 commit 0bd7cfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/git-peek
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof pl))r
`.trim()+`
`,{flags:{help:{type:"boolean",default:!1,alias:"h",isRequired:!1},version:{type:"boolean",default:!1,alias:"v",isRequired:!1},editor:{type:"string",isMultiple:!1,isRequired:!1,default:"auto",alias:"e",description:"editor to open with, possible values: auto, code, vim, subl. By default, it will search $EDITOR. If not found, it will try code, then subl, then vim."}}})}async getArchive(n,o){let u;try{u=await this._unzip(n)}catch(l){try{this.didUseFallback=!0,u=await this._unzip(o)}catch(t){console.error(`Invalid repository link. Tried:
- ${n}
- ${o}`),uE(),process.exit()}}return this.archive=u,u}async run(){var G,J;let n=this.parse(),{help:o,version:u}=n.flags,l=(J=(G=n.input[0])==null?void 0:G.trim())!=null?J:"";o&&(n.showHelp(0),process.exit(0)),u&&(n.showVersion(),process.exit(0));let{flags:{editor:t="auto"}}=n,p,_=!1;if(!l.includes("://")&&l.split("/").length===2){let[ne,X]=l.split("/");X.trim().length?l=`https://github.com/${ne}/${X}`:_=!0}for(_||(_=!l||!l.includes("/")||l.includes(" "));!p;){_&&(l=await this.search(l),_=!l||!l.includes("/")||l.includes(" "));try{p=WX.default(l)}catch(ne){try{l=await this.search(l),_=!l||!l.includes("/")||l.includes(" ")}catch(X){console.log(X)}}}let y=new Date().getTime();Qc=KX.default.dirSync({unsafeCleanup:!0}),this.destination=Qc.name,JT=!1,process.once("beforeExit",uE),process.once("SIGABRT",uE),process.once("SIGQUIT",uE);let w=p.ref;w||(w="master");let R=p.filepath;R||(R="README.md");let k=oE.default.join(Qc.name,R);if(p.resource==="github.com"){let ne=w==="main"?"master":"main";await Promise.any([this.prefetchGithub(p.name,p.owner,R,w,ne,k).catch(console.error),this.unzip(p.owner,p.name,w,ne,Qc.name)])}else await this.clone(p.href,Qc.name);let M=!t||t==="auto"?process.env.EDITOR:t;if(!(M==null?void 0:M.trim().length))for(let ne of XX)try{M=$X.default.sync(ne),(M.includes("code")||M.includes("subl"))&&(M='"'+M+'"');break}catch(X){}let q=[],g=0;M.includes("code")?(M+=" --wait",g=1,q.push("--new-window"),R&&q.push(`-g "${oE.default.resolve(k)}":0:0`)):M.includes("subl")?(M+=" --wait",g=2,q.push("--new-window"),R&&q.push(`"${oE.default.resolve(k)}":0:0`)):M.includes("vi")&&(g=3),console.log({chosenEditor:M,editorMode:g}),await new Promise((ne,X)=>{if(g===3){let fe=function(){ge||(process.stdin.setRawMode(!1),process.stdin.resume(),ne(),ge=!0)};process.stdin.setRawMode(!0),process.stdin.pause(),this.slowTask=ZT.default.spawn(M,[Qc.name,...q],{env:process.env,stdio:"inherit",detached:!1,cwd:Qc.name});let ge=!1;this.slowTask.once("close",fe),this.slowTask.once("exit",fe),this.slowTask.once("error",fe)}else{let ge=`${M} "${oE.default.join(Qc.name)}" ${q.join(" ")}`.trim();this.slowTask=ZT.default.exec(ge,{env:process.env,stdio:"inherit",cwd:Qc.name},(fe,Se)=>fe?X(fe):ne(Se))}this.log(`\u{1F4BB} Launched editor in ${((new Date().getTime()-y)/1e3).toFixed(2)}s`)}),uE(),process.exit()}};s3.description="Quickly open a remote Git repository with your local text editor into a temporary folder.",s3.usage="[git link or github link]",s3.args=[{name:"url"}];process.on("unhandledRejection",r=>console.error(r));process.on("unhandledException",r=>console.error(r));Vu=new s3;Vu.run();
- ${o}`),uE(),process.exit()}}return this.archive=u,u}async run(){var G,J;let n=this.parse(),{help:o,version:u}=n.flags,l=(J=(G=n.input[0])==null?void 0:G.trim())!=null?J:"";o&&(n.showHelp(0),process.exit(0)),u&&(n.showVersion(),process.exit(0));let{flags:{editor:t="auto"}}=n,p,_=!1;if(!l.includes("://")&&l.split("/").length===2){let[ne,X]=l.split("/");X.trim().length?l=`https://github.com/${ne}/${X}`:_=!0}for(_||(_=!l||!l.includes("/")||l.includes(" "));!p;){_&&(l=await this.search(l),_=!l||!l.includes("/")||l.includes(" "));try{p=WX.default(l)}catch(ne){try{l=await this.search(l),_=!l||!l.includes("/")||l.includes(" ")}catch(X){console.log(X)}}}let y=new Date().getTime();Qc=KX.default.dirSync({unsafeCleanup:!0}),this.destination=Qc.name,JT=!1,process.once("beforeExit",uE),process.once("SIGABRT",uE),process.once("SIGQUIT",uE);let w=p.ref;w||(w="master");let R=p.filepath;R||(R="README.md");let k=oE.default.join(Qc.name,R);if(p.resource==="github.com"){let ne=w==="main"?"master":"main";await Promise.any([this.prefetchGithub(p.name,p.owner,R,w,ne,k).catch(console.error),this.unzip(p.owner,p.name,w,ne,Qc.name)])}else await this.clone(p.href,Qc.name);let M=!t||t==="auto"?process.env.EDITOR:t;if(!(M==null?void 0:M.trim().length))for(let ne of XX)try{M=$X.default.sync(ne),(M.includes("code")||M.includes("subl"))&&(M='"'+M+'"');break}catch(X){}let q=[],g=0;M.includes("code")?(M+=" --wait",g=1,q.push("--new-window"),R&&q.push(`-g "${oE.default.resolve(k)}":0:0`)):M.includes("subl")?(M+=" --wait",g=2,q.push("--new-window"),R&&q.push(`"${oE.default.resolve(k)}":0:0`)):M.includes("vi")&&(g=3),await new Promise((ne,X)=>{if(g===3){let fe=function(){ge||(process.stdin.setRawMode(!1),process.stdin.resume(),ne(),ge=!0)};process.stdin.setRawMode(!0),process.stdin.pause(),this.slowTask=ZT.default.spawn(M,[Qc.name,...q],{env:process.env,stdio:"inherit",detached:!1,cwd:Qc.name});let ge=!1;this.slowTask.once("close",fe),this.slowTask.once("exit",fe),this.slowTask.once("error",fe)}else{let ge=`${M} "${oE.default.join(Qc.name)}" ${q.join(" ")}`.trim();this.slowTask=ZT.default.exec(ge,{env:process.env,stdio:"inherit",cwd:Qc.name},(fe,Se)=>fe?X(fe):ne(Se))}this.log(`\u{1F4BB} Launched editor in ${((new Date().getTime()-y)/1e3).toFixed(2)}s`)}),uE(),process.exit()}};s3.description="Quickly open a remote Git repository with your local text editor into a temporary folder.",s3.usage="[git link or github link]",s3.args=[{name:"url"}];process.on("unhandledRejection",r=>console.error(r));process.on("unhandledException",r=>console.error(r));Vu=new s3;Vu.run();
/*
object-assign
(c) Sindre Sorhus
Expand Down

0 comments on commit 0bd7cfc

Please sign in to comment.