From b0d3274b2d98147679f91c468327287675de0c08 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 25 Apr 2022 16:13:35 +0800 Subject: [PATCH] fix(plugin-system-settings): cannot read property cliArgs of undefined --- packages/plugins/system-settings/src/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugins/system-settings/src/plugin.ts b/packages/plugins/system-settings/src/plugin.ts index a51e20b15..c367fcbc1 100644 --- a/packages/plugins/system-settings/src/plugin.ts +++ b/packages/plugins/system-settings/src/plugin.ts @@ -4,11 +4,11 @@ import { resolve } from 'path'; export class SystemSettingsPlugin extends Plugin { async install(options: InstallOptions) { - const [opts] = options.cliArgs; + const { cliArgs } = options; await this.db.getRepository('systemSettings').create({ values: { title: 'NocoBase', - appLang: opts?.lang || 'en-US', + appLang: cliArgs?.[0]?.opts?.lang || process.env.APP_LANG || 'en-US', logo: { title: 'nocobase-logo', filename: '682e5ad037dd02a0fe4800a3e91c283b.png',