project2txt 1.1.0 → 1.1.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 +2 -2
- package/index.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,10 +31,10 @@ project2txt <path_or_repo> [flags]
|
|
|
31
31
|
project2txt ./myProject --out bundle.txt --maxLines 5000
|
|
32
32
|
|
|
33
33
|
# short repo syntax
|
|
34
|
-
project2txt facebook/react --dir scans --
|
|
34
|
+
project2txt facebook/react --dir scans --out react.txt
|
|
35
35
|
|
|
36
36
|
# full URL
|
|
37
|
-
project2txt https://github.com/vercel/next.js --dir output --
|
|
37
|
+
project2txt https://github.com/vercel/next.js --dir output --out next.txt --maxMb 10
|
|
38
38
|
|
|
39
39
|
# keep clone folder
|
|
40
40
|
project2txt user/repo --keep
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const ignore = require('ignore');
|
|
|
10
10
|
const pino = require('pino');
|
|
11
11
|
const { execSync } = require('child_process');
|
|
12
12
|
const tmp = require('tmp');
|
|
13
|
+
const CWD = process.cwd();
|
|
13
14
|
tmp.setGracefulCleanup();
|
|
14
15
|
|
|
15
16
|
const logger = pino({ level: 'info' });
|
|
@@ -46,7 +47,7 @@ function cloneIfNeeded(input) {
|
|
|
46
47
|
return clonePath;
|
|
47
48
|
}
|
|
48
49
|
projectRoot = cloneIfNeeded(projectRoot);
|
|
49
|
-
outDir
|
|
50
|
+
outDir = path.resolve(CWD, outDir);
|
|
50
51
|
fs.mkdirSync(outDir, { recursive: true });
|
|
51
52
|
|
|
52
53
|
const maxBytes = maxSizeMb * 1024 * 1024;
|