From 4be884a1bd3b9b879d399686b65e1b9a8ffda85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Tue, 1 Mar 2022 09:44:10 +0800 Subject: [PATCH] Optimized timezone ask (#77) --- installer/OptionalPackages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/OptionalPackages.php b/installer/OptionalPackages.php index a0ffbd48..641b5f90 100644 --- a/installer/OptionalPackages.php +++ b/installer/OptionalPackages.php @@ -131,14 +131,14 @@ function ($value) { throw new \InvalidArgumentException('You should type a time zone name, like Asia/Shanghai. Or type n to skip.'); } - return $value; + return trim($value); }, null, 'n' ); - $content = file_get_contents($this->installerSource . '/resources/bin/hyperf.stub'); if ($answer != 'n') { + $content = file_get_contents($this->installerSource . '/resources/bin/hyperf.stub'); $content = str_replace('%TIME_ZONE%', $answer, $content); file_put_contents($this->projectRoot . '/bin/hyperf.php', $content); }