From 1b6c3dc9fadf76cbadf74d2cbba277c9f07c1b71 Mon Sep 17 00:00:00 2001 From: James Hulse Date: Tue, 5 Nov 2024 12:00:53 +1300 Subject: [PATCH 1/3] Look for certificates in valet linux config directory --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index 75d8965..78d8907 100644 --- a/src/index.ts +++ b/src/index.ts @@ -583,6 +583,10 @@ function determineDevelopmentEnvironmentConfigPath(): string|undefined { if (fs.existsSync(valetConfigPath())) { return valetConfigPath() } + + if (fs.existsSync(valetLinuxConfigPath())) { + return valetLinuxConfigPath() + } } /** @@ -627,3 +631,10 @@ function herdWindowsConfigPath(): string { function valetConfigPath(): string { return path.resolve(os.homedir(), '.config', 'valet') } + +/** + * Valet Linux's configuration directory. + */ +function valetLinuxConfigPath(): string { + return path.resolve(os.homedir(), '.valet') +} \ No newline at end of file From 50bdb38451b9e0d20b6dd3aa9eb1a86814c5cbf9 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 6 Nov 2024 09:02:34 +1100 Subject: [PATCH 2/3] Prefix mac valet function --- src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 78d8907..6c1bf8c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -218,7 +218,7 @@ function resolveLaravelPlugin(pluginConfig: Required): LaravelPlug server.config.logger.info(` ${colors.green('➜')} Using Herd certificate to secure Vite.`) } - if (resolvedConfig.server.https.key.startsWith(valetConfigPath())) { + if (resolvedConfig.server.https.key.startsWith(valetMacConfigPath())) { server.config.logger.info(` ${colors.green('➜')} Using Valet certificate to secure Vite.`) } } @@ -580,8 +580,8 @@ function determineDevelopmentEnvironmentConfigPath(): string|undefined { return herdWindowsConfigPath() } - if (fs.existsSync(valetConfigPath())) { - return valetConfigPath() + if (fs.existsSync(valetMacConfigPath())) { + return valetMacConfigPath() } if (fs.existsSync(valetLinuxConfigPath())) { @@ -626,9 +626,9 @@ function herdWindowsConfigPath(): string { } /** - * Valet's configuration directory. + * Valet's Mac configuration directory. */ -function valetConfigPath(): string { +function valetMacConfigPath(): string { return path.resolve(os.homedir(), '.config', 'valet') } @@ -637,4 +637,4 @@ function valetConfigPath(): string { */ function valetLinuxConfigPath(): string { return path.resolve(os.homedir(), '.valet') -} \ No newline at end of file +} From 07c50ed00e688fa67261fc9650a529548e02a157 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 6 Nov 2024 09:04:16 +1100 Subject: [PATCH 3/3] Show log message on linux --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6c1bf8c..80a1ccd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -218,7 +218,7 @@ function resolveLaravelPlugin(pluginConfig: Required): LaravelPlug server.config.logger.info(` ${colors.green('➜')} Using Herd certificate to secure Vite.`) } - if (resolvedConfig.server.https.key.startsWith(valetMacConfigPath())) { + if (resolvedConfig.server.https.key.startsWith(valetMacConfigPath()) || resolvedConfig.server.https.key.startsWith(valetLinuxConfigPath())) { server.config.logger.info(` ${colors.green('➜')} Using Valet certificate to secure Vite.`) } }