Skip to content

Commit

Permalink
Break early when running in Artisan mode
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 1, 2023
1 parent db93e53 commit 993004a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions hyde
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* - Proxy mode: Defers to the Hyde installation in the current directory.
*/

// If this is being run from the source code, run in artisan mode
if (getcwd() === __DIR__ || getcwd() === __FILE__) {
return require_once __DIR__ . '/bin/hyde';
}

// Define working directory
define('HYDE_WORKING_DIR', getcwd());

// Determine the mode to run in
define('HYDE_MODE', (function () {
// If this is being run from the source code, run in artisan mode
if (HYDE_WORKING_DIR === __DIR__ || HYDE_WORKING_DIR === __FILE__) {
return 'artisan';
}

// If the current directory contains a Hyde binary, run in proxy mode
if (file_exists(HYDE_WORKING_DIR . '/hyde')) {
return 'proxy';
Expand Down Expand Up @@ -68,5 +68,4 @@ return match (HYDE_MODE) {
$kernel->terminate($input, $status);
exit($status);
})(),
'artisan' => require_once __DIR__ . '/bin/hyde'
};

0 comments on commit 993004a

Please sign in to comment.