mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 13:01:59 +03:00
fix: version check
This commit is contained in:
parent
d6b640726e
commit
fbe2543c03
@ -1,8 +1,11 @@
|
||||
#!/usr/bin/env zx
|
||||
import 'zx/globals';
|
||||
|
||||
import { createRequire } from 'node:module';
|
||||
import path from 'node:path';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const repoRootDir = path.join(__dirname, '..', '..', '..');
|
||||
const electronRootDir = path.join(__dirname, '..');
|
||||
const publicDistDir = path.join(electronRootDir, 'resources');
|
||||
@ -21,11 +24,7 @@ console.log('build with following dir', {
|
||||
});
|
||||
|
||||
// step 0: check version match
|
||||
const electronPackageJson = await import(`${electronRootDir}/package.json`, {
|
||||
assert: {
|
||||
type: 'json',
|
||||
},
|
||||
});
|
||||
const electronPackageJson = require(`${electronRootDir}/package.json`);
|
||||
if (releaseVersionEnv && electronPackageJson.version !== releaseVersionEnv) {
|
||||
throw new Error(
|
||||
`Version mismatch, expected ${releaseVersionEnv} but got ${electronPackageJson.version}`
|
||||
|
Loading…
Reference in New Issue
Block a user