From 1abd3d2efdeeaa570017bf79472e3538910c82a5 Mon Sep 17 00:00:00 2001 From: juneszh Date: Mon, 19 Sep 2022 18:26:25 +0800 Subject: [PATCH] Fixed config init in composer script --- src/Admin.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Admin.php b/src/Admin.php index d490a02..15aabe6 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -115,11 +115,11 @@ public static function install() $configFile = realpath('config/app.php'); if (!$configFile) { throw new Exception('Missing configuration file: config/app.php'); - } else { - Config::init($configFile); - self::insertConfig(); - self::createTable(); } + + Config::init($configFile); + self::insertConfig(); + self::createTable(); } /** @@ -384,6 +384,13 @@ public static function download() throw new Exception('PHP-CLI required.'); } + $configFile = realpath('config/app.php'); + if (!$configFile) { + throw new Exception('Missing configuration file: config/app.php'); + } + + Config::init($configFile); + $package = 'juneszh/alight-admin'; $version = InstalledVersions::getPrettyVersion($package);