mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: change build script to plain javascript
This commit is contained in:
1 parent
6c5532e298
commit
b0df7024e6
8 files changed
+27
-59
No files matched your search
@@ -0,0 +1,24 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const spawn = require('cross-spawn');
|
||||
|
||||
const args = ['jest', '--coverage'];
|
||||
const [, , argv2, argv3] = process.argv;
|
||||
|
||||
if (argv2 && !argv2.startsWith('-')) {
|
||||
args.push(argv2);
|
||||
if (argv3 && !argv3.startsWith('-')) {
|
||||
args.push('--collectCoverageFrom');
|
||||
if (argv3.endsWith('.ts')) {
|
||||
args.push(`**/${argv3}`);
|
||||
} else {
|
||||
args.push(`**/${argv3}/**/*.ts`);
|
||||
}
|
||||
args.push(...process.argv.slice(4));
|
||||
} else {
|
||||
args.push(...process.argv.slice(3));
|
||||
}
|
||||
} else {
|
||||
args.push('packages/.+\\.spec\\.ts', ...process.argv.slice(2));
|
||||
}
|
||||
|
||||
spawn('npx', args, { stdio: 'inherit' });
|
||||
Reference in new issue
Block a user