Skip to content

Commit b6a2592

Browse files
committed
✨ Automatically open project in default browser
1 parent 1e361ae commit b6a2592

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Command/NewCommand.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ public function __invoke(): int
253253
$this->info(sprintf('Finished after %d seconds.', round($time_elapsed_secs, 2)));
254254
}
255255

256-
$this->info('🌐 https://' . $webRoot);
256+
$url = 'https://' . $webRoot;
257+
$this->info('🌐 ' . $url);
258+
if (!$isProject && $valetAvailable) {
259+
$user = $_SERVER['SUDO_USER'] ?? $_SERVER['USER'];
260+
(new Process(['sudo', '-u', $user, 'open', $url]))->run();
261+
}
257262

258263
return self::SUCCESS;
259264
}

0 commit comments

Comments
 (0)