编译 domain 判断mac
This commit is contained in:
parent
36759d3ff2
commit
e2e5e6924f
|
|
@ -12,6 +12,7 @@
|
|||
"devDependencies": {
|
||||
"@babel/cli": "^7.12.13",
|
||||
"@babel/core": "^7.12.13",
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.12.13",
|
||||
"@babel/preset-env": "^7.12.13",
|
||||
"@babel/preset-typescript": "^7.12.13",
|
||||
|
|
@ -24,7 +25,10 @@
|
|||
"@types/react": "^17.0.2",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"assert": "^2.0.0",
|
||||
"chalk": "^4.1.0",
|
||||
|
||||
"cross-env": "^7.0.2",
|
||||
"cross-spawn": "^6.0.5",
|
||||
"fs-extra": "^10.0.0",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"miniprogram-api-typings": "^3.4.6",
|
||||
|
|
@ -33,7 +37,7 @@
|
|||
"typescript": "^4.5.2"
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "ts-node ./scripts/buildBaseEntityDict && npm link ./src/base-app-domain",
|
||||
"prebuild": "ts-node ./scripts/make.ts",
|
||||
"build": "tsc",
|
||||
"get:area": "ts-node ./scripts/getAmapArea.ts",
|
||||
"clean:mp": "ts-node ./scripts/cleanDtsInWechatMp"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
import chalk from 'chalk';
|
||||
import spawn from 'cross-spawn';
|
||||
|
||||
// ts-node scripts/build-app-domain & npm link ./app-domain
|
||||
console.log(`${chalk.greenBright(`build oak-app-domain`)}`);
|
||||
|
||||
const result = spawn.sync(
|
||||
'ts-node',
|
||||
[require.resolve('./buildBaseEntityDict.ts')],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
// const result2 = spawn.sync('npm -v', [], { stdio: 'inherit', shell: true });
|
||||
|
||||
if (result.status === 0) {
|
||||
console.log(`${chalk.greenBright(`build 执行完成`)}`);
|
||||
} else {
|
||||
Error(`${chalk.redBright(`build 执行失败`)}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(`${chalk.greenBright(`npm link oak-app-domain`)}`);
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
const result2 = spawn.sync(
|
||||
`${isMac ? 'sudo' : ''}`,
|
||||
[`npm link ${process.cwd()}/src/base-app-domain`],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
|
||||
if (result2.status === 0) {
|
||||
console.log(`${chalk.greenBright(`link 执行完成`)}`);
|
||||
} else {
|
||||
Error(`${chalk.redBright(`link 执行失败`)}`);
|
||||
process.exit(1);
|
||||
}
|
||||
Loading…
Reference in New Issue