Skip to content

Commit

Permalink
feat: allow opening URLs on multiple OSs
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Sep 21, 2021
1 parent 562d7da commit d5efddf
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 d5efddf

Please sign in to comment.