gitpick 3.15.0-canary.0 → 3.15.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.
- package/README.md +2 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Simply copy the Github URL and run with `npx gitpick <url>`, be that a public or
|
|
|
12
12
|
|
|
13
13
|
- Target is optional, and `gitpick` follows default git clone behavior. Read [usage](#usage) for more details.
|
|
14
14
|
|
|
15
|
+
<img width="400" alt="GitPick Meme" src="https://github.com/user-attachments/assets/dde09ae9-1ee4-4cd8-a181-91f8e6ed6ba6" />
|
|
16
|
+
|
|
15
17
|
## Features
|
|
16
18
|
|
|
17
19
|
- Autodetect branch and target directory if not provided explicitly.
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var y=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,W=Objec
|
|
|
5
5
|
`);let c=G().start();try{c.stop();let l=g.resolve(e.target);if(r.watch&&(r.overwrite=!0),p.existsSync(l+(e.type==="blob"?"/"+e.path.split("/").pop():""))&&(await p.promises.readdir(l)).length&&!r.overwrite){let m=e.type==="tree"?"The target directory is not empty. Do you want to overwrite the files?":"The target file already exists. Do you want to overwrite the file?",{overwrite:u}=await A.prompt([{type:"confirm",name:"overwrite",message:m,default:!1}]);if(!u)throw new Error("Chose not to overwrite files");c.info("You can use -o | --overwrite flag to skip this prompt")}if(await x(c,e,r,l),r.watch){let m=d(r.watch);setInterval(async()=>await x(c,e,r,l),m)}}catch(l){console.log(`
|
|
6
6
|
`),c.fail("An error occurred");let m=R(l);console.log(`
|
|
7
7
|
`+m.toString()+`
|
|
8
|
-
`),process.exit(1)}});async function D(t,o){let r=await p.promises.readdir(t,{withFileTypes:!0});await p.promises.mkdir(o,{recursive:!0});for(let e of r){if(e.name===".git")continue;let n=g.join(t,e.name),s=g.join(o,e.name);e.isDirectory()?await D(n,s):await p.promises.copyFile(n,s)}}var x=async(t,o,r,e)=>{try{let n=N(),s=`https://${o.token?o.token+"@":o.token}github.com/${o.owner}/${o.repository}.git`,c=g.join(H.tmpdir(),`${o.repository}-${Date.now()}`);r.watch||t.start(`Cloning ${o.type} from repository`),await n.clone(s,c,["--depth","1","--single-branch","--branch",o.branch]);let i=g.join(c,o.path);(await p.promises.stat(i)).isDirectory()?(await p.promises.mkdir(e,{recursive:!0}),await D(i,e)):(await p.promises.mkdir(e,{recursive:!0}),await p.promises.copyFile(i,e+"/"+o.path.split("/").pop())),r.watch?t.succeed("Synced at "+new Date().toLocaleTimeString()):t.succeed(`${o.type.slice(0,1).toUpperCase()+o.type.slice(1)} cloned from repository`),await p.promises.rm(c,{recursive:!0,force:!0})}catch(n){throw new Error("An error occurred while cloning the repository")}};import a from"chalk";import{Command as F}from"commander";var b={name:"gitpick",version:"3.
|
|
8
|
+
`),process.exit(1)}});async function D(t,o){let r=await p.promises.readdir(t,{withFileTypes:!0});await p.promises.mkdir(o,{recursive:!0});for(let e of r){if(e.name===".git")continue;let n=g.join(t,e.name),s=g.join(o,e.name);e.isDirectory()?await D(n,s):await p.promises.copyFile(n,s)}}var x=async(t,o,r,e)=>{try{let n=N(),s=`https://${o.token?o.token+"@":o.token}github.com/${o.owner}/${o.repository}.git`,c=g.join(H.tmpdir(),`${o.repository}-${Date.now()}`);r.watch||t.start(`Cloning ${o.type} from repository`),await n.clone(s,c,["--depth","1","--single-branch","--branch",o.branch]);let i=g.join(c,o.path);(await p.promises.stat(i)).isDirectory()?(await p.promises.mkdir(e,{recursive:!0}),await D(i,e)):(await p.promises.mkdir(e,{recursive:!0}),await p.promises.copyFile(i,e+"/"+o.path.split("/").pop())),r.watch?t.succeed("Synced at "+new Date().toLocaleTimeString()):t.succeed(`${o.type.slice(0,1).toUpperCase()+o.type.slice(1)} cloned from repository`),await p.promises.rm(c,{recursive:!0,force:!0})}catch(n){throw new Error("An error occurred while cloning the repository")}};import a from"chalk";import{Command as F}from"commander";var b={name:"gitpick",version:"3.15.0",description:"With gitpick, you can clone precisely what you need.",keywords:["clone","degit","directory","file","folder","git","github","scaffolding","template","url"],homepage:"https://github.com/nrjdalal/gitpick#readme",bugs:"https://github.com/nrjdalal/gitpick/issues",repository:"nrjdalal/gitpick",funding:"https://github.com/sponsors/nrjdalal",license:"MIT",author:{name:"Neeraj Dalal",email:"admin@nrjdalal.com",url:"https://nrjdalal.com"},type:"module",bin:{degit:"./dist/index.js",gitpick:"./dist/index.js"},files:["dist"],scripts:{build:"tsup",dev:"tsup --watch",prepare:'if [ "$NODE_ENV" != "production" ]; then npx simple-git-hooks; fi',"publish:latest":"NODE_ENV=production changeset publish","publish:local":"bun run build && npm version minor && changeset publish",test:"bun run build && node dist/index.js",tests:"bash tests.sh"},"simple-git-hooks":{"pre-commit":"npx lint-staged","commit-msg":"npx commitlint --edit $1"},dependencies:{chalk:"^5.4.1",commander:"^13.1.0",inquirer:"^12.5.0",ora:"^8.2.0","simple-git":"^3.27.0",zod:"^3.24.2","zod-validation-error":"^3.4.0"},devDependencies:{"@commitlint/cli":"^19.8.0","@commitlint/config-conventional":"^19.8.0","@ianvs/prettier-plugin-sort-imports":"^4.4.1","@types/node":"^22.13.13","lint-staged":"^15.5.0",prettier:"^3.5.3","simple-git-hooks":"^2.12.1","sort-package-json":"^2.15.1",tsup:"^8.4.0",typescript:"^5.8.2"}};process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function O(){let t=new F().name("gitpick").description("With gitpick, you can clone precisely what you need.").version(b.version||"1.0.0","-v, --version","display the version number"),o=process.argv.slice(2),r=["-v","--version","-h","--help","help","clone"];o.length&&!r.includes(o[0])&&process.argv.splice(2,0,"clone"),t.addCommand(j),t.configureHelp({formatHelp:()=>`${a.bold("With gitpick, you can clone precisely what you need.")}
|
|
9
9
|
|
|
10
10
|
\u{1F680} More awesome tools at ${a.cyan("https://github.com/nrjdalal")}
|
|
11
11
|
|