mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
fix: add support for windows home path
This commit is contained in:
@@ -13,7 +13,7 @@ class PublishCommand extends Command
|
||||
public function handle()
|
||||
{
|
||||
$configFile = implode(DIRECTORY_SEPARATOR, [
|
||||
$_SERVER['HOME'],
|
||||
$_SERVER['HOME'] ?? $_SERVER['USERPROFILE'],
|
||||
'.expose',
|
||||
'config.php',
|
||||
]);
|
||||
|
||||
@@ -19,7 +19,7 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
||||
|
||||
protected function detectTld(): string
|
||||
{
|
||||
$valetConfigFile = $_SERVER['HOME'].DIRECTORY_SEPARATOR.'.config'.DIRECTORY_SEPARATOR.'valet'.DIRECTORY_SEPARATOR.'config.json';
|
||||
$valetConfigFile = $_SERVER['HOME'] ?? $_SERVER['USERPROFILE'].DIRECTORY_SEPARATOR.'.config'.DIRECTORY_SEPARATOR.'valet'.DIRECTORY_SEPARATOR.'config.json';
|
||||
|
||||
if (file_exists($valetConfigFile)) {
|
||||
$valetConfig = json_decode(file_get_contents($valetConfigFile));
|
||||
|
||||
@@ -18,13 +18,11 @@ class StoreAuthenticationTokenCommand extends Command
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$config = config('expose', []);
|
||||
|
||||
if (! is_null($this->argument('token'))) {
|
||||
$this->info('Setting the expose authentication token to "'.$this->argument('token').'"');
|
||||
|
||||
$configFile = implode(DIRECTORY_SEPARATOR, [
|
||||
$_SERVER['HOME'],
|
||||
$_SERVER['HOME'] ?? $_SERVER['USERPROFILE'],
|
||||
'.expose',
|
||||
'config.php',
|
||||
]);
|
||||
|
||||
@@ -45,7 +45,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
$configFile = implode(DIRECTORY_SEPARATOR, [
|
||||
$_SERVER['HOME'] ?? __DIR__,
|
||||
$_SERVER['HOME'] ?? $_SERVER['USERPROFILE'] ?? __DIR__,
|
||||
'.expose',
|
||||
'config.php',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user