Skip to content

Commit b5a1b3d

Browse files
committed
wip
1 parent 07cf849 commit b5a1b3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Console/NewCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5656
if($installWordPress) {
5757
$dbName = $input->getOption('dbname') ?? (new SymfonyStyle($input, $output))->ask('What is the name of your database?', str_replace('-', '_', $folder));
5858
$dbUser = $input->getOption('dbuser') ?? (new SymfonyStyle($input, $output))->ask('What is the user of your database?', 'root');
59-
$dbPass = $input->getOption('dbpass') ?? (new SymfonyStyle($input, $output))->ask('What is the password of your database?', 'root');
59+
$dbPass = $input->getOption('dbpass') ?? (new SymfonyStyle($input, $output))->ask('What is the password of your database?');
6060
$dbHost = $input->getOption('dbhost') ?? (new SymfonyStyle($input, $output))->ask('What is the host of your database?', 'localhost');
6161
}
6262

6363
$slug = $this->determineSlug($folder);
6464
$prefix = $this->determineSlug($folder, true);
6565

66-
$workingDirectory = $folder !== '.' ? getcwd().'/'.$folder : '.';
66+
$baseDirectory = $folder !== '.' ? getcwd().'/'.$folder : '.';
67+
$workingDirectory = $baseDirectory;
6768

6869
if ($installWordPress) {
6970
$this->installWordPress($workingDirectory, $input, $output);
@@ -107,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107108
if ($installWordPress) {
108109
$this->replaceInFile('database_name_here', $dbName, $workingDirectory.'/../../../wp-config.php');
109110
$this->replaceInFile('username_here', $dbUser, $workingDirectory.'/../../../wp-config.php');
110-
$this->replaceInFile('password_here', $dbPass, $workingDirectory.'/../../../wp-config.php');
111+
$this->replaceInFile('password_here', $dbPass ?? '', $workingDirectory.'/../../../wp-config.php');
111112
$this->replaceInFile('localhost', $dbHost, $workingDirectory.'/../../../wp-config.php');
112113
$this->replaceInFile("define( 'WP_DEBUG', false );", "define( 'WP_DEBUG', false );\ndefine( 'WP_ENVIRONMENT_TYPE', 'development' );", $workingDirectory.'/../../../wp-config.php');
113114
}
@@ -135,7 +136,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
135136
}
136137

137138
$output->writeln(PHP_EOL.'<comment>🌊 Your boilerplate is ready, go create something beautiful!</comment>');
138-
$output->writeln(PHP_EOL.'<info>🏗️ Your theme is here: '.$workingDirectory.'</info>');
139+
$output->writeln(PHP_EOL.'<info>🏗️ Your theme path: '.$workingDirectory.'</info>');
140+
if($installWordPress) {
141+
$output->writeln(PHP_EOL.'<info>📝 Your WordPress path: '.$baseDirectory.'</info>');
142+
}
139143
$output->writeln(PHP_EOL.'<comment>✨ If you like TailPress, please consider starring the repo at https://github.com/tailpress/tailpress</comment>');
140144
}
141145

0 commit comments

Comments
 (0)