gitpick 3.14.0 → 3.15.0-canary.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 +4 -4
- package/dist/index.js +1 -1
- package/package.json +12 -14
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ Simply copy the Github URL and run with `npx gitpick <url>`, be that a public or
|
|
|
14
14
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
|
-
- Autodetect branch and target directory if not provided.
|
|
17
|
+
- Autodetect branch and target directory if not provided explicitly.
|
|
18
18
|
- Clone a file or directory from a GitHub repository.
|
|
19
|
-
- Clone from public or private repositories.
|
|
20
|
-
- Sync changes with remote repository at a specified interval.
|
|
21
|
-
- Use shorthands like `
|
|
19
|
+
- Clone from public or private repositories using personal access tokens.
|
|
20
|
+
- Sync changes with remote repository at a specified interval using `-w` or `--watch` flag.
|
|
21
|
+
- Use shorthands like `npx gitpick nrjdalal/gitpick` or `npx gitpick nrjdalal/gitpick/src`, no need to provide full URL.
|
|
22
22
|
|
|
23
23
|
<img width="840" alt="Image" src="https://github.com/user-attachments/assets/78b92ed3-7d5c-48f4-8975-23bd744d3a3c" />
|
|
24
24
|
|
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.14.1",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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitpick",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0-canary.0",
|
|
4
4
|
"description": "With gitpick, you can clone precisely what you need.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clone",
|
|
@@ -48,24 +48,22 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"chalk": "^5.4.1",
|
|
50
50
|
"commander": "^13.1.0",
|
|
51
|
-
"inquirer": "^12.
|
|
51
|
+
"inquirer": "^12.5.0",
|
|
52
52
|
"ora": "^8.2.0",
|
|
53
53
|
"simple-git": "^3.27.0",
|
|
54
|
-
"zod": "^3.24.
|
|
54
|
+
"zod": "^3.24.2",
|
|
55
55
|
"zod-validation-error": "^3.4.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@commitlint/cli": "^19.7.1",
|
|
61
|
-
"@commitlint/config-conventional": "^19.7.1",
|
|
58
|
+
"@commitlint/cli": "^19.8.0",
|
|
59
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
62
60
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
63
|
-
"@types/node": "^22.13.
|
|
64
|
-
"lint-staged": "^15.
|
|
65
|
-
"prettier": "^3.
|
|
66
|
-
"simple-git-hooks": "^2.
|
|
67
|
-
"sort-package-json": "^2.
|
|
68
|
-
"tsup": "^8.
|
|
69
|
-
"typescript": "^5.
|
|
61
|
+
"@types/node": "^22.13.13",
|
|
62
|
+
"lint-staged": "^15.5.0",
|
|
63
|
+
"prettier": "^3.5.3",
|
|
64
|
+
"simple-git-hooks": "^2.12.1",
|
|
65
|
+
"sort-package-json": "^2.15.1",
|
|
66
|
+
"tsup": "^8.4.0",
|
|
67
|
+
"typescript": "^5.8.2"
|
|
70
68
|
}
|
|
71
69
|
}
|