fix: upgrade
This commit is contained in:
parent
464a963316
commit
06c942103b
5
.changeset/itchy-houses-join.md
Normal file
5
.changeset/itchy-houses-join.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@nocobase/server": patch
|
||||
---
|
||||
|
||||
fix upgrade
|
@ -1,3 +1,6 @@
|
||||
import { fsExists } from '@nocobase/utils';
|
||||
import fs from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import Application from '../application';
|
||||
import { ApplicationNotInstall } from '../errors/application-not-install';
|
||||
|
||||
@ -10,7 +13,12 @@ export default (app: Application) => {
|
||||
.action(async (...cliArgs) => {
|
||||
const [options] = cliArgs;
|
||||
console.log('start options', options);
|
||||
if (options.quickstart) {
|
||||
const file = resolve(process.cwd(), 'storage/app-upgrading');
|
||||
const upgrading = await fsExists(file);
|
||||
if (upgrading) {
|
||||
await app.upgrade();
|
||||
await fs.promises.rm(file);
|
||||
} else if (options.quickstart) {
|
||||
if (await app.isInstalled()) {
|
||||
await app.upgrade();
|
||||
} else {
|
||||
|
@ -815,7 +815,16 @@ export class PluginManager {
|
||||
} else {
|
||||
await this.upgradeByNpm(options as any);
|
||||
}
|
||||
await this.app.upgrade();
|
||||
const file = resolve(process.cwd(), 'storage/app-upgrading');
|
||||
await fs.promises.writeFile(file, '', 'utf-8');
|
||||
// await this.app.upgrade();
|
||||
if (process.env.IS_DEV_CMD) {
|
||||
await tsxRerunning();
|
||||
} else {
|
||||
await execa('pnpm', ['nocobase', 'pm2-restart'], {
|
||||
env: process.env,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
1
storage/.gitignore
vendored
1
storage/.gitignore
vendored
@ -3,3 +3,4 @@ tmp
|
||||
app.watch.ts
|
||||
/e2e
|
||||
nocobase.conf
|
||||
app-upgrading
|
||||
|
Loading…
Reference in New Issue
Block a user