batch-exec-cli 1.3.1 → 1.3.4
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 +3 -0
- package/package.json +5 -4
- package/src/cli.js +5 -2
- package/src/directoryLister.js +0 -2
- package/src/ignoreParser.js +1 -1
- /package/{LICENSE.md → LICENSE} +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
高效批量命令执行工具,能够遍历目录内所有直接子目录并执行命令。
|
|
4
4
|
|
|
5
|
+
[](https://github.com/chandq/batch-exec-cli/actions/workflows/release.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/batch-exec-cli)
|
|
7
|
+
|
|
5
8
|
## 功能特性
|
|
6
9
|
|
|
7
10
|
- 🚀 高效遍历目标目录的所有直接子目录, 默认并行执行
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "batch-exec-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Efficiently iterate through directories and execute commands with progress display and parallel execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"batch-exec": "src/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"test": "
|
|
11
|
+
"test": "node --test",
|
|
12
|
+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='test/**'",
|
|
12
13
|
"lint": "eslint src/ test/"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
@@ -28,9 +29,9 @@
|
|
|
28
29
|
],
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/chandq/batch-exec.git"
|
|
32
|
+
"url": "git+https://github.com/chandq/batch-exec-cli.git"
|
|
32
33
|
},
|
|
33
|
-
"author": "",
|
|
34
|
+
"author": "chandq",
|
|
34
35
|
"license": "MIT",
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"minimist": "^1.2.8",
|
package/src/cli.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
import path from 'path';
|
|
4
5
|
import minimist from 'minimist';
|
|
5
6
|
import { $ } from 'zx';
|
|
6
7
|
import { batchExecute, parseIgnoreFile } from './index.js';
|
|
7
8
|
import { cyan, yellow, green, red, gray, bold, dim, magenta, blue } from './utils/colors.js';
|
|
8
9
|
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const { version } = require('../package.json');
|
|
12
|
+
|
|
9
13
|
$.verbose = false;
|
|
10
14
|
|
|
11
15
|
async function main() {
|
|
@@ -40,7 +44,6 @@ async function main() {
|
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
const skipPaths = await parseIgnoreFile(ignoreFilePath);
|
|
43
|
-
|
|
44
47
|
if (argv.verbose) {
|
|
45
48
|
console.log(bold('\n🚀 Batch Executor\n'));
|
|
46
49
|
console.log(`Target directory: ${cyan(targetDir)}`);
|
|
@@ -69,7 +72,7 @@ async function main() {
|
|
|
69
72
|
|
|
70
73
|
function printHelp() {
|
|
71
74
|
console.log(`
|
|
72
|
-
${bold('Batch Executor')} ${dim(
|
|
75
|
+
${bold('Batch Executor')} ${dim(`v${version}`)}
|
|
73
76
|
|
|
74
77
|
${cyan('Usage:')} batch-exec [options] <directory> <command> [args...]
|
|
75
78
|
|
package/src/directoryLister.js
CHANGED
|
@@ -4,10 +4,8 @@ import { shouldSkipDirectory } from './ignoreParser.js';
|
|
|
4
4
|
|
|
5
5
|
export async function listDirectSubdirectories(targetDir, skipPatterns = []) {
|
|
6
6
|
const absoluteTargetDir = path.resolve(targetDir);
|
|
7
|
-
|
|
8
7
|
try {
|
|
9
8
|
const entries = await fs.readdir(absoluteTargetDir, { withFileTypes: true });
|
|
10
|
-
|
|
11
9
|
const subdirs = [];
|
|
12
10
|
|
|
13
11
|
for (const entry of entries) {
|
package/src/ignoreParser.js
CHANGED
/package/{LICENSE.md → LICENSE}
RENAMED
|
File without changes
|