ccommand 1.0.67 → 1.0.69

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/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Se=Object.create;var ie=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Me(t))!Ae.call(e,n)&&n!==r&&ie(e,n,{get:()=>t[n],enumerable:!(i=Le(t,n))||i.enumerable});return e};var I=(e,t,r)=>(r=e!=null?Se(Pe(e)):{},Ne(t||!e||!e.__esModule?ie(r,"default",{value:e,enumerable:!0}):r,e));var U=K((Ke,le)=>{"use strict";le.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var me=K((Ue,pe)=>{"use strict";var Fe=require("os"),ue=require("tty"),E=U(),{env:$}=process,v;E("no-color")||E("no-colors")||E("color=false")||E("color=never")?v=0:(E("color")||E("colors")||E("color=true")||E("color=always"))&&(v=1);"FORCE_COLOR"in $&&($.FORCE_COLOR==="true"?v=1:$.FORCE_COLOR==="false"?v=0:v=$.FORCE_COLOR.length===0?1:Math.min(parseInt($.FORCE_COLOR,10),3));function J(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function X(e,t){if(v===0)return 0;if(E("color=16m")||E("color=full")||E("color=truecolor"))return 3;if(E("color=256"))return 2;if(e&&!t&&v===void 0)return 0;let r=v||0;if($.TERM==="dumb")return r;if(process.platform==="win32"){let i=Fe.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in $)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in $)||$.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0;if($.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $){let i=parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:r}function He(e){let t=X(e,e&&e.isTTY);return J(t)}pe.exports={supportsColor:He,stdout:J(X(!0,ue.isatty(1))),stderr:J(X(!0,ue.isatty(2)))}});var ge=K((Je,de)=>{"use strict";var ze=me(),L=U();function fe(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Q(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(L("no-hyperlink")||L("no-hyperlinks")||L("hyperlink=false")||L("hyperlink=never"))return!1;if(L("hyperlink=true")||L("hyperlink=always")||"NETLIFY"in t)return!0;if(!ze.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=fe(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=fe(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}de.exports={supportsHyperlink:Q,stdout:Q(process.stdout),stderr:Q(process.stderr)}});var P=I(require("fs/promises")),be=require("fs"),D=I(require("path")),u=require("lazy-js-utils"),Te=I(require("fast-glob")),a=I(require("@simon_he/colorize"));var p="\x1B[",F="\x1B]",S="\x07",B=";",ce=process.env.TERM_PROGRAM==="Apple_Terminal",c={};c.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?p+(e+1)+"G":p+(t+1)+";"+(e+1)+"H"};c.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=p+-e+"D":e>0&&(r+=p+e+"C"),t<0?r+=p+-t+"A":t>0&&(r+=p+t+"B"),r};c.cursorUp=(e=1)=>p+e+"A";c.cursorDown=(e=1)=>p+e+"B";c.cursorForward=(e=1)=>p+e+"C";c.cursorBackward=(e=1)=>p+e+"D";c.cursorLeft=p+"G";c.cursorSavePosition=ce?"\x1B7":p+"s";c.cursorRestorePosition=ce?"\x1B8":p+"u";c.cursorGetPosition=p+"6n";c.cursorNextLine=p+"E";c.cursorPrevLine=p+"F";c.cursorHide=p+"?25l";c.cursorShow=p+"?25h";c.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=c.eraseLine+(r<e-1?c.cursorUp():"");return e&&(t+=c.cursorLeft),t};c.eraseEndLine=p+"K";c.eraseStartLine=p+"1K";c.eraseLine=p+"2K";c.eraseDown=p+"J";c.eraseUp=p+"1J";c.eraseScreen=p+"2J";c.scrollUp=p+"S";c.scrollDown=p+"T";c.clearScreen="\x1Bc";c.clearTerminal=process.platform==="win32"?`${c.eraseScreen}${p}0f`:`${c.eraseScreen}${p}3J${p}H`;c.beep=S;c.link=(e,t)=>[F,"8",B,B,t,S,e,F,"8",B,B,S].join("");c.image=(e,t={})=>{let r=`${F}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+S};c.iTerm={setCwd:(e=process.cwd())=>`${F}50;CurrentDir=${e}${S}`,annotation:(e,t={})=>{let r=`${F}1337;`,i=typeof t.x<"u",n=typeof t.y<"u";if((i||n)&&!(i&&n&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+S}};var ae=c;var G=I(ge(),1);function O(e,t,{target:r="stdout",...i}={}){return G.default[r]?ae.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}O.isSupported=G.default.stdout;O.stderr=(e,t,r={})=>O(e,t,{target:"stderr",...r});O.stderr.isSupported=G.default.stderr;var Z="1.0.67";var H=I(require("@simon_he/colorize")),Y=require("lazy-js-utils");var ee=console.log;function he(e){let{status:t}=(0,Y.jsShell)("gum -v","pipe");if(t!==0){ee((0,H.default)({color:"blue",text:e?"\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5gum...":"install gum..."}));let{status:r}=(0,Y.jsShell)("brew install gum");if(r!==0){let{status:i}=(0,Y.jsShell)(`sudo mkdir -p /etc/apt/keyrings
1
+ "use strict";var Se=Object.create;var ie=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Me(t))!Ae.call(e,n)&&n!==r&&ie(e,n,{get:()=>t[n],enumerable:!(i=Le(t,n))||i.enumerable});return e};var I=(e,t,r)=>(r=e!=null?Se(Pe(e)):{},Ne(t||!e||!e.__esModule?ie(r,"default",{value:e,enumerable:!0}):r,e));var U=K((Ke,le)=>{"use strict";le.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var me=K((Ue,pe)=>{"use strict";var Fe=require("os"),ue=require("tty"),E=U(),{env:$}=process,v;E("no-color")||E("no-colors")||E("color=false")||E("color=never")?v=0:(E("color")||E("colors")||E("color=true")||E("color=always"))&&(v=1);"FORCE_COLOR"in $&&($.FORCE_COLOR==="true"?v=1:$.FORCE_COLOR==="false"?v=0:v=$.FORCE_COLOR.length===0?1:Math.min(parseInt($.FORCE_COLOR,10),3));function J(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function X(e,t){if(v===0)return 0;if(E("color=16m")||E("color=full")||E("color=truecolor"))return 3;if(E("color=256"))return 2;if(e&&!t&&v===void 0)return 0;let r=v||0;if($.TERM==="dumb")return r;if(process.platform==="win32"){let i=Fe.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in $)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in $)||$.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0;if($.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $){let i=parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:r}function He(e){let t=X(e,e&&e.isTTY);return J(t)}pe.exports={supportsColor:He,stdout:J(X(!0,ue.isatty(1))),stderr:J(X(!0,ue.isatty(2)))}});var ge=K((Je,de)=>{"use strict";var ze=me(),L=U();function fe(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Q(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(L("no-hyperlink")||L("no-hyperlinks")||L("hyperlink=false")||L("hyperlink=never"))return!1;if(L("hyperlink=true")||L("hyperlink=always")||"NETLIFY"in t)return!0;if(!ze.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=fe(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=fe(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}de.exports={supportsHyperlink:Q,stdout:Q(process.stdout),stderr:Q(process.stderr)}});var P=I(require("fs/promises")),be=require("fs"),D=I(require("path")),u=require("lazy-js-utils"),Te=I(require("fast-glob")),a=I(require("@simon_he/colorize"));var p="\x1B[",F="\x1B]",S="\x07",B=";",ce=process.env.TERM_PROGRAM==="Apple_Terminal",c={};c.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?p+(e+1)+"G":p+(t+1)+";"+(e+1)+"H"};c.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=p+-e+"D":e>0&&(r+=p+e+"C"),t<0?r+=p+-t+"A":t>0&&(r+=p+t+"B"),r};c.cursorUp=(e=1)=>p+e+"A";c.cursorDown=(e=1)=>p+e+"B";c.cursorForward=(e=1)=>p+e+"C";c.cursorBackward=(e=1)=>p+e+"D";c.cursorLeft=p+"G";c.cursorSavePosition=ce?"\x1B7":p+"s";c.cursorRestorePosition=ce?"\x1B8":p+"u";c.cursorGetPosition=p+"6n";c.cursorNextLine=p+"E";c.cursorPrevLine=p+"F";c.cursorHide=p+"?25l";c.cursorShow=p+"?25h";c.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=c.eraseLine+(r<e-1?c.cursorUp():"");return e&&(t+=c.cursorLeft),t};c.eraseEndLine=p+"K";c.eraseStartLine=p+"1K";c.eraseLine=p+"2K";c.eraseDown=p+"J";c.eraseUp=p+"1J";c.eraseScreen=p+"2J";c.scrollUp=p+"S";c.scrollDown=p+"T";c.clearScreen="\x1Bc";c.clearTerminal=process.platform==="win32"?`${c.eraseScreen}${p}0f`:`${c.eraseScreen}${p}3J${p}H`;c.beep=S;c.link=(e,t)=>[F,"8",B,B,t,S,e,F,"8",B,B,S].join("");c.image=(e,t={})=>{let r=`${F}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+S};c.iTerm={setCwd:(e=process.cwd())=>`${F}50;CurrentDir=${e}${S}`,annotation:(e,t={})=>{let r=`${F}1337;`,i=typeof t.x<"u",n=typeof t.y<"u";if((i||n)&&!(i&&n&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+S}};var ae=c;var G=I(ge(),1);function O(e,t,{target:r="stdout",...i}={}){return G.default[r]?ae.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}O.isSupported=G.default.stdout;O.stderr=(e,t,r={})=>O(e,t,{target:"stderr",...r});O.stderr.isSupported=G.default.stderr;var Z="1.0.69";var H=I(require("@simon_he/colorize")),Y=require("lazy-js-utils");var ee=console.log;function he(e){let{status:t}=(0,Y.jsShell)("gum -v","pipe");if(t!==0){ee((0,H.default)({color:"blue",text:e?"\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5gum...":"install gum..."}));let{status:r}=(0,Y.jsShell)("brew install gum");if(r!==0){let{status:i}=(0,Y.jsShell)(`sudo mkdir -p /etc/apt/keyrings
2
2
  curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
3
3
  echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
4
4
  sudo apt update && sudo apt install gum`);if(i!==0){let n=O(e?"gum\u5B98\u7F51\u94FE\u63A5":"the official website of gum","https://github.com/charmbracelet/gum#installation");return ee((0,H.default)({color:"red",text:`${e?"gum\u5B89\u88C5\u5931\u8D25,\u4F60\u53EF\u4EE5\u81EA\u884C\u4ECE\u4EE5\u4E0B\u94FE\u63A5\u5B89\u88C5":"gum install error, you can install it yourself through"} ${(0,H.default)({color:"yellow",text:n,bold:!0})}`}))}}ee((0,H.default)({color:"green",text:e?"gum\u5B89\u88C5\u6210\u529F \u{1F389}":"gum install successfully \u{1F389}"}))}}var $e=I(require("fs/promises"));function ye(e){return new Promise(t=>{$e.default.readFile(e,"utf-8").then(r=>{let i=[];for(let n of r.matchAll(/.PHONY:\s*([\w0-9\-]+)/g)){let l;if(!n||!(l=n[1]))continue;let x=new RegExp(`^${l}:[
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Le=Object.create;var B=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ae=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fe=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},ce=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Pe(t))!Ne.call(e,n)&&n!==r&&B(e,n,{get:()=>t[n],enumerable:!(i=Me(t,n))||i.enumerable});return e};var I=(e,t,r)=>(r=e!=null?Le(Ae(e)):{},ce(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e)),He=e=>ce(B({},"__esModule",{value:!0}),e);var J=U((Xe,ue)=>{"use strict";ue.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var fe=U((Qe,me)=>{"use strict";var ze=require("os"),pe=require("tty"),E=J(),{env:$}=process,v;E("no-color")||E("no-colors")||E("color=false")||E("color=never")?v=0:(E("color")||E("colors")||E("color=true")||E("color=always"))&&(v=1);"FORCE_COLOR"in $&&($.FORCE_COLOR==="true"?v=1:$.FORCE_COLOR==="false"?v=0:v=$.FORCE_COLOR.length===0?1:Math.min(parseInt($.FORCE_COLOR,10),3));function X(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Q(e,t){if(v===0)return 0;if(E("color=16m")||E("color=full")||E("color=truecolor"))return 3;if(E("color=256"))return 2;if(e&&!t&&v===void 0)return 0;let r=v||0;if($.TERM==="dumb")return r;if(process.platform==="win32"){let i=ze.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in $)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in $)||$.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0;if($.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $){let i=parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:r}function Ve(e){let t=Q(e,e&&e.isTTY);return X(t)}me.exports={supportsColor:Ve,stdout:X(Q(!0,pe.isatty(1))),stderr:X(Q(!0,pe.isatty(2)))}});var he=U((Ze,ge)=>{"use strict";var Be=fe(),L=J();function de(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Z(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(L("no-hyperlink")||L("no-hyperlinks")||L("hyperlink=false")||L("hyperlink=never"))return!1;if(L("hyperlink=true")||L("hyperlink=always")||"NETLIFY"in t)return!0;if(!Be.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=de(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=de(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}ge.exports={supportsHyperlink:Z,stdout:Z(process.stdout),stderr:Z(process.stderr)}});var Ke={};Fe(Ke,{ccommand:()=>je});module.exports=He(Ke);var P=I(require("fs/promises")),Te=require("fs"),q=I(require("path")),u=require("lazy-js-utils"),Ee=I(require("fast-glob")),a=I(require("@simon_he/colorize"));var p="\x1B[",F="\x1B]",S="\x07",G=";",ae=process.env.TERM_PROGRAM==="Apple_Terminal",c={};c.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?p+(e+1)+"G":p+(t+1)+";"+(e+1)+"H"};c.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=p+-e+"D":e>0&&(r+=p+e+"C"),t<0?r+=p+-t+"A":t>0&&(r+=p+t+"B"),r};c.cursorUp=(e=1)=>p+e+"A";c.cursorDown=(e=1)=>p+e+"B";c.cursorForward=(e=1)=>p+e+"C";c.cursorBackward=(e=1)=>p+e+"D";c.cursorLeft=p+"G";c.cursorSavePosition=ae?"\x1B7":p+"s";c.cursorRestorePosition=ae?"\x1B8":p+"u";c.cursorGetPosition=p+"6n";c.cursorNextLine=p+"E";c.cursorPrevLine=p+"F";c.cursorHide=p+"?25l";c.cursorShow=p+"?25h";c.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=c.eraseLine+(r<e-1?c.cursorUp():"");return e&&(t+=c.cursorLeft),t};c.eraseEndLine=p+"K";c.eraseStartLine=p+"1K";c.eraseLine=p+"2K";c.eraseDown=p+"J";c.eraseUp=p+"1J";c.eraseScreen=p+"2J";c.scrollUp=p+"S";c.scrollDown=p+"T";c.clearScreen="\x1Bc";c.clearTerminal=process.platform==="win32"?`${c.eraseScreen}${p}0f`:`${c.eraseScreen}${p}3J${p}H`;c.beep=S;c.link=(e,t)=>[F,"8",G,G,t,S,e,F,"8",G,G,S].join("");c.image=(e,t={})=>{let r=`${F}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+S};c.iTerm={setCwd:(e=process.cwd())=>`${F}50;CurrentDir=${e}${S}`,annotation:(e,t={})=>{let r=`${F}1337;`,i=typeof t.x<"u",n=typeof t.y<"u";if((i||n)&&!(i&&n&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+S}};var le=c;var Y=I(he(),1);function O(e,t,{target:r="stdout",...i}={}){return Y.default[r]?le.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}O.isSupported=Y.default.stdout;O.stderr=(e,t,r={})=>O(e,t,{target:"stderr",...r});O.stderr.isSupported=Y.default.stderr;var ee="1.0.67";var H=I(require("@simon_he/colorize")),W=require("lazy-js-utils");var te=console.log;function $e(e){let{status:t}=(0,W.jsShell)("gum -v","pipe");if(t!==0){te((0,H.default)({color:"blue",text:e?"\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5gum...":"install gum..."}));let{status:r}=(0,W.jsShell)("brew install gum");if(r!==0){let{status:i}=(0,W.jsShell)(`sudo mkdir -p /etc/apt/keyrings
1
+ "use strict";var Le=Object.create;var B=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ae=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fe=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},ce=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Pe(t))!Ne.call(e,n)&&n!==r&&B(e,n,{get:()=>t[n],enumerable:!(i=Me(t,n))||i.enumerable});return e};var I=(e,t,r)=>(r=e!=null?Le(Ae(e)):{},ce(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e)),He=e=>ce(B({},"__esModule",{value:!0}),e);var J=U((Xe,ue)=>{"use strict";ue.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var fe=U((Qe,me)=>{"use strict";var ze=require("os"),pe=require("tty"),E=J(),{env:$}=process,v;E("no-color")||E("no-colors")||E("color=false")||E("color=never")?v=0:(E("color")||E("colors")||E("color=true")||E("color=always"))&&(v=1);"FORCE_COLOR"in $&&($.FORCE_COLOR==="true"?v=1:$.FORCE_COLOR==="false"?v=0:v=$.FORCE_COLOR.length===0?1:Math.min(parseInt($.FORCE_COLOR,10),3));function X(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Q(e,t){if(v===0)return 0;if(E("color=16m")||E("color=full")||E("color=truecolor"))return 3;if(E("color=256"))return 2;if(e&&!t&&v===void 0)return 0;let r=v||0;if($.TERM==="dumb")return r;if(process.platform==="win32"){let i=ze.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in $)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in $)||$.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0;if($.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $){let i=parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:r}function Ve(e){let t=Q(e,e&&e.isTTY);return X(t)}me.exports={supportsColor:Ve,stdout:X(Q(!0,pe.isatty(1))),stderr:X(Q(!0,pe.isatty(2)))}});var he=U((Ze,ge)=>{"use strict";var Be=fe(),L=J();function de(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Z(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(L("no-hyperlink")||L("no-hyperlinks")||L("hyperlink=false")||L("hyperlink=never"))return!1;if(L("hyperlink=true")||L("hyperlink=always")||"NETLIFY"in t)return!0;if(!Be.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=de(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=de(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}ge.exports={supportsHyperlink:Z,stdout:Z(process.stdout),stderr:Z(process.stderr)}});var Ke={};Fe(Ke,{ccommand:()=>je});module.exports=He(Ke);var P=I(require("fs/promises")),Te=require("fs"),q=I(require("path")),u=require("lazy-js-utils"),Ee=I(require("fast-glob")),a=I(require("@simon_he/colorize"));var p="\x1B[",F="\x1B]",S="\x07",G=";",ae=process.env.TERM_PROGRAM==="Apple_Terminal",c={};c.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?p+(e+1)+"G":p+(t+1)+";"+(e+1)+"H"};c.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=p+-e+"D":e>0&&(r+=p+e+"C"),t<0?r+=p+-t+"A":t>0&&(r+=p+t+"B"),r};c.cursorUp=(e=1)=>p+e+"A";c.cursorDown=(e=1)=>p+e+"B";c.cursorForward=(e=1)=>p+e+"C";c.cursorBackward=(e=1)=>p+e+"D";c.cursorLeft=p+"G";c.cursorSavePosition=ae?"\x1B7":p+"s";c.cursorRestorePosition=ae?"\x1B8":p+"u";c.cursorGetPosition=p+"6n";c.cursorNextLine=p+"E";c.cursorPrevLine=p+"F";c.cursorHide=p+"?25l";c.cursorShow=p+"?25h";c.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=c.eraseLine+(r<e-1?c.cursorUp():"");return e&&(t+=c.cursorLeft),t};c.eraseEndLine=p+"K";c.eraseStartLine=p+"1K";c.eraseLine=p+"2K";c.eraseDown=p+"J";c.eraseUp=p+"1J";c.eraseScreen=p+"2J";c.scrollUp=p+"S";c.scrollDown=p+"T";c.clearScreen="\x1Bc";c.clearTerminal=process.platform==="win32"?`${c.eraseScreen}${p}0f`:`${c.eraseScreen}${p}3J${p}H`;c.beep=S;c.link=(e,t)=>[F,"8",G,G,t,S,e,F,"8",G,G,S].join("");c.image=(e,t={})=>{let r=`${F}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+S};c.iTerm={setCwd:(e=process.cwd())=>`${F}50;CurrentDir=${e}${S}`,annotation:(e,t={})=>{let r=`${F}1337;`,i=typeof t.x<"u",n=typeof t.y<"u";if((i||n)&&!(i&&n&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+S}};var le=c;var Y=I(he(),1);function O(e,t,{target:r="stdout",...i}={}){return Y.default[r]?le.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}O.isSupported=Y.default.stdout;O.stderr=(e,t,r={})=>O(e,t,{target:"stderr",...r});O.stderr.isSupported=Y.default.stderr;var ee="1.0.69";var H=I(require("@simon_he/colorize")),W=require("lazy-js-utils");var te=console.log;function $e(e){let{status:t}=(0,W.jsShell)("gum -v","pipe");if(t!==0){te((0,H.default)({color:"blue",text:e?"\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5gum...":"install gum..."}));let{status:r}=(0,W.jsShell)("brew install gum");if(r!==0){let{status:i}=(0,W.jsShell)(`sudo mkdir -p /etc/apt/keyrings
2
2
  curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
3
3
  echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
4
4
  sudo apt update && sudo apt install gum`);if(i!==0){let n=O(e?"gum\u5B98\u7F51\u94FE\u63A5":"the official website of gum","https://github.com/charmbracelet/gum#installation");return te((0,H.default)({color:"red",text:`${e?"gum\u5B89\u88C5\u5931\u8D25,\u4F60\u53EF\u4EE5\u81EA\u884C\u4ECE\u4EE5\u4E0B\u94FE\u63A5\u5B89\u88C5":"gum install error, you can install it yourself through"} ${(0,H.default)({color:"yellow",text:n,bold:!0})}`}))}}te((0,H.default)({color:"green",text:e?"gum\u5B89\u88C5\u6210\u529F \u{1F389}":"gum install successfully \u{1F389}"}))}}var ye=I(require("fs/promises"));function we(e){return new Promise(t=>{ye.default.readFile(e,"utf-8").then(r=>{let i=[];for(let n of r.matchAll(/.PHONY:\s*([\w0-9\-]+)/g)){let l;if(!n||!(l=n[1]))continue;let x=new RegExp(`^${l}:[
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccommand",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "packageManager": "pnpm@6.32.3",
5
5
  "description": "ccommand",
6
6
  "author": "Simon He",