mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Fix issue where the open command runs as root
Here we take the currently logged in user, and run the open command as that user instead of root. This ensures that your default browser choice works.
This commit is contained in:
@@ -184,8 +184,8 @@
|
||||
*/
|
||||
$app->command('open [domain]', function ($domain = null) {
|
||||
$url = "http://".($domain ?: Site::host(getcwd())).'.'.Configuration::read()['domain'];
|
||||
|
||||
passthru("open ".escapeshellarg($url));
|
||||
// Run the 'open' command as the currently logged in user instead of root
|
||||
passthru('sudo --user=`stat -f%Su /dev/console` open ' . escapeshellarg($url));
|
||||
})->descriptions('Open the site for the current (or specified) directory in your browser');
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user