From dac1b6ecf98b5fea909e6bcefb089e4d81d21e3a Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 6 Nov 2024 22:27:08 +0100 Subject: [PATCH] improve command --- recipe/setupTasks.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/recipe/setupTasks.php b/recipe/setupTasks.php index e2a2bf3..6a24db3 100644 --- a/recipe/setupTasks.php +++ b/recipe/setupTasks.php @@ -20,12 +20,7 @@ task('setup:createDbConfig', function () { run("touch {{db_conf_path}}"); } if (test("[ -f {{db_conf_path}} ]")) { - $db_host = ask('database host', 'localhost'); - $db_port = ask('database port', '3306'); - $db_name = ask('database name'); - $db_user = ask('database user'); - $db_pass = askHiddenResponse('database password'); - run('printf "[client]\nuser='.$db_user.'\npassword=\"'.$db_pass.'\"\nhost='.$db_host.'\nport='.$db_port.'\n\n[mysql]\ndatabase=\"'.$db_name.'\"" > {{db_conf_path}}'); + run('printf "[client]\nhost=\"'.ask('database host', 'localhost').'\"\nport=\"'.ask('database port', '3306').'\"\nuser=\"'.ask('database user').'\"\npassword=\"'.askHiddenResponse('database password').'\"\n\n[mysql]\ndatabase=\"'.ask('database name').'\"" > {{db_conf_path}}'); info('config successful created'); } else { throw new \RuntimeException('can not create {{db_conf_path}}, task stopped');