Skip to content

Commit

Permalink
Merge pull request #148 from owenvoke/feature/open-multi-os
Browse files Browse the repository at this point in the history
feat: allow opening URLs on multiple OSs
  • Loading branch information
nunomaduro authored Sep 21, 2021
2 parents 562d7da + d5efddf commit 19ac6f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Commands/OpenCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public function handle()
));
}

passthru(sprintf('open https://%s', $domain));
$openerCommand = 'open';

if (PHP_OS_FAMILY === 'Windows') {
$openerCommand = 'start';
} elseif (PHP_OS_FAMILY === 'Linux') {
$openerCommand = 'xdg-open';
}

passthru(sprintf('%s https://%s', $openerCommand, $domain));
}
}

0 comments on commit 19ac6f0

Please sign in to comment.