xl1 0.0.9 → 0.1.0

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,2 +1,3 @@
1
- "use strict";var _chunkNEJSZOZXjs = require('../chunk-NEJSZOZX.js');var o=_chunkNEJSZOZXjs.a.call(void 0, "fs"),f=_chunkNEJSZOZXjs.a.call(void 0, "archiver"),r=_chunkNEJSZOZXjs.a.call(void 0, "path"),u=_chunkNEJSZOZXjs.a.call(void 0, "axios");async function g(e,t=!1){let s=(e==="."?r.basename(process.cwd()):r.basename(e))+".zip",n=r.join(e,s);o.existsSync(n)&&o.unlinkSync(n);let i=o.createWriteStream(n),c=f("zip",{zlib:{level:9}});c.pipe(i);let p=r.join(e,".gitignore");if(t&&o.existsSync(p)){let d=o.readFileSync(p,"utf8").split(`
2
- `).filter(l=>l&&!l.startsWith("#")).map(l=>`**/${l}`);c.glob("**/*",{cwd:e,ignore:d})}else c.glob("**/*",{cwd:e,ignore:["**/node_modules/**","**/py_modules/**","**/vendor/**","**/.ipynb_checkpoints/**","**/.nuxt/**","**/tmp/**","**/dist/**","**/cache/**","**/.angular/**","**/.cache/**","**/.sfdx/**","**/.sf/**"]});return await c.finalize(),n}async function m(e,t,s="#general"){let n=new FormData;n.append("content",o.createReadStream(e)),n.append("channels",s),n.append("token",t),n.append("filename",r.basename(e)),n.append("initial_comment",r.basename(e)),u.post("https://slack.com/api/files.upload",n).then(i=>{i.data.ok?console.log("Successfully",e):console.error(i.data)}).catch(i=>{console.error("Error sending request:",i)})}var y={command:"*",describe:"jsss",builder:{file:{alias:"f",describe:"file or directory",type:"string",default:"."},gitignore:{alias:"g",describe:"Use .gitignore patterns",type:"boolean",default:!1},token:{alias:"t",describe:"token",type:"string",default:null},channel:{alias:"c",describe:"channel",type:"string",default:"#general"}},handler(e){(async()=>{try{let t=e.token||process.env.SLACK_TOKEN;t||(console.error("Error: token is required"),process.exit(1));let s,n=o.statSync(e.file);n.isDirectory()?s=await g(e.file,e.gitignore):n.isFile()?s=e.file:(console.error("Error: path must be a directory or file"),process.exit(1)),await m(s,t,e.channel)}catch(t){console.error("Error:",t.message),process.exit(1)}})()}},h=()=>{let e=_chunkNEJSZOZXjs.a.call(void 0, "yargs").scriptName("jsss");e.command(y);let t=e.parse()};h();
1
+ #! /usr/bin/env node
2
+ "use strict";var _chunkNEJSZOZXjs = require('../chunk-NEJSZOZX.js');var u=_chunkNEJSZOZXjs.b.call(void 0, (q,d)=>{var o=_chunkNEJSZOZXjs.a.call(void 0, "fs"),y=_chunkNEJSZOZXjs.a.call(void 0, "archiver"),i=_chunkNEJSZOZXjs.a.call(void 0, "path"),b=_chunkNEJSZOZXjs.a.call(void 0, "axios");async function h(e,n=!1,r=null){let s=(e==="."?i.basename(process.cwd()):i.basename(e))+".zip",t=i.join(e,s);o.existsSync(t)&&o.unlinkSync(t);let f=o.createWriteStream(t),c=y("zip",{zlib:{level:9},forceZip64:!1,password:r});c.pipe(f);let p=i.join(e,".gitignore");if(n&&o.existsSync(p)){let g=o.readFileSync(p,"utf8").split(`
3
+ `).filter(l=>l&&!l.startsWith("#")).map(l=>`**/${l}`);c.glob("**/*",{cwd:e,ignore:g})}else c.glob("**/*",{cwd:e,ignore:["**/node_modules/**","**/py_modules/**","**/vendor/**","**/.ipynb_checkpoints/**","**/.nuxt/**","**/tmp/**","**/dist/**","**/cache/**","**/.angular/**","**/.cache/**","**/.sfdx/**","**/.sf/**","**/.DS_Store","**/.AppleDouble","**/.LSOverride"]});return await c.finalize(),t}async function S(e,n,r="#general"){let s=new FormData;s.append("content",o.createReadStream(e)),s.append("channels",r),s.append("token",n),s.append("filename",i.basename(e)),s.append("initial_comment",i.basename(e)),b.post("https://slack.com/api/files.upload",s).then(t=>{t.data.ok?console.log("Successfully",e):console.error(t.data)}).catch(t=>{console.error("Error sending request:",t)})}var k={command:"*",describe:"jsss",builder:{file:{alias:"f",describe:"file or directory",type:"string",default:"."},gitignore:{alias:"g",describe:"Use .gitignore patterns",type:"boolean",default:!1},token:{alias:"t",describe:"token",type:"string",default:null},channel:{alias:"c",describe:"channel",type:"string",default:"#general"},password:{alias:"p",describe:"password",type:"string",default:null}},handler(e){(async()=>{try{let n=e.token||process.env.SLACK_TOKEN;n||(console.error("Error: token is required"),process.exit(1));let r,s=o.statSync(e.file);s.isDirectory()?r=await h(e.file,e.gitignore,e.password):s.isFile()?r=e.file:(console.error("Error: path must be a directory or file"),process.exit(1)),await S(r,n,e.channel)}catch(n){console.error("Error:",n.message),process.exit(1)}})()}};d.exports=k});var w=()=>{let e=_chunkNEJSZOZXjs.a.call(void 0, "yargs").scriptName("jsss");e.command(u());let n=e.parse()};w();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xl1",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "just some xlsx script.",
5
5
  "bin": {
6
6
  "bash1": "dist/bash1/index.js",