1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | const chalk = require('chalk');
|
8 | const pkg = require('../package.json');
|
9 | const fs = require('fs');
|
10 | const path = require('path');
|
11 | const helDistPath = path.resolve(__dirname, '../hel_dist/hel-meta.json');
|
12 | const existHelMeata = fs.existsSync(helDistPath);
|
13 |
|
14 |
|
15 | if (!existHelMeata) {
|
16 | console.log(chalk.red("Run the 'npm run build' command first.\n"));
|
17 | process.exit(1);
|
18 | }
|
19 | const { app } = JSON.parse(fs.readFileSync(helDistPath, 'utf-8'));
|
20 |
|
21 | if (app?.build_version !== pkg.version) {
|
22 | console.log(
|
23 | chalk.red('The package.json version number and the hel_dist/hel-meta.json version number must be the same.\n')
|
24 | );
|
25 | process.exit(1);
|
26 | }
|