git-ripper 1.2.1 → 1.3.1
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 +1 -1
- package/package.json +1 -1
- package/src/downloader.js +3 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/git-ripper)
|
|
6
6
|
[](https://github.com/sairajB/git-ripper/blob/main/LICENSE)
|
|
7
|
-
[](https://www.npmjs.com/package/git-ripper)
|
|
8
8
|
[](https://github.com/sairajB/git-ripper/issues)
|
|
9
9
|
[](https://github.com/sairajB/git-ripper/stargazers)
|
|
10
10
|
|
package/package.json
CHANGED
package/src/downloader.js
CHANGED
|
@@ -7,7 +7,7 @@ import cliProgress from "cli-progress";
|
|
|
7
7
|
import pLimit from "p-limit";
|
|
8
8
|
|
|
9
9
|
// Set concurrency limit (adjustable based on network performance)
|
|
10
|
-
const limit = pLimit(
|
|
10
|
+
const limit = pLimit(500);
|
|
11
11
|
|
|
12
12
|
// Ensure __dirname and __filename are available in ESM
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -90,6 +90,8 @@ const downloadFolder = async ({ owner, repo, branch, folderPath }, outputDir) =>
|
|
|
90
90
|
const fileDownloadPromises = contents
|
|
91
91
|
.filter((item) => item.type === "blob")
|
|
92
92
|
.map((item) => {
|
|
93
|
+
// Keep the original structure by preserving the folder name
|
|
94
|
+
// For a path like "src/components/Button.js" relative to "src", store as "components/Button.js"
|
|
93
95
|
const relativePath = item.path.substring(folderPath.length).replace(/^\//, "");
|
|
94
96
|
const outputFilePath = path.join(outputDir, relativePath);
|
|
95
97
|
|
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { downloadFolder } from './downloader.js';
|
|
|
4
4
|
|
|
5
5
|
const initializeCLI = () => {
|
|
6
6
|
program
|
|
7
|
-
.version('1.
|
|
7
|
+
.version('1.3.1')
|
|
8
8
|
.description('Clone specific folders from GitHub repositories')
|
|
9
9
|
.argument('<url>', 'GitHub URL of the folder to clone')
|
|
10
10
|
.option('-o, --output <directory>', 'Output directory', process.cwd())
|