fix(plugin-system-settings): cannot read property cliArgs of undefined

This commit is contained in:
chenos 2022-04-25 16:13:35 +08:00
parent 327e413b6d
commit b0d3274b2d

View File

@ -4,11 +4,11 @@ import { resolve } from 'path';
export class SystemSettingsPlugin extends Plugin { export class SystemSettingsPlugin extends Plugin {
async install(options: InstallOptions) { async install(options: InstallOptions) {
const [opts] = options.cliArgs; const { cliArgs } = options;
await this.db.getRepository('systemSettings').create({ await this.db.getRepository('systemSettings').create({
values: { values: {
title: 'NocoBase', title: 'NocoBase',
appLang: opts?.lang || 'en-US', appLang: cliArgs?.[0]?.opts?.lang || process.env.APP_LANG || 'en-US',
logo: { logo: {
title: 'nocobase-logo', title: 'nocobase-logo',
filename: '682e5ad037dd02a0fe4800a3e91c283b.png', filename: '682e5ad037dd02a0fe4800a3e91c283b.png',