Skip to content

Commit 93ba8f5

Browse files
author
youncccat
committed
[Feat] add utils for using $ to exec
1 parent 477ca2e commit 93ba8f5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/commitlint-wizardoc-e2e-tests/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"main": "index.js",
55
"license": "MIT",
66
"devDependencies": {
7+
"@types/shelljs": "^0.8.8",
78
"zx": "^1.12.0"
89
},
910
"dependencies": {
10-
"commitlint-config-wizardoc": "^1.0.0"
11+
"commitlint-config-wizardoc": "^1.0.0",
12+
"shelljs": "^0.8.4"
1113
}
1214
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import shell from "shelljs";
2+
3+
export const $ = (pieces: TemplateStringsArray, args?: unknown[]) =>
4+
shell.exec(
5+
pieces.reduce((pre, cur, i) => pre + cur + ((args ?? [])[i] ?? ""), "")
6+
);

tsconfig.base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"declaration": true,
99
"skipLibCheck": true,
1010
"skipDefaultLibCheck": true,
11-
"allowSyntheticDefaultImports": true
11+
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true
1213
}
1314
}

0 commit comments

Comments
 (0)