Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look for certificates in valet linux config directory #307

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): 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()) || resolvedConfig.server.https.key.startsWith(valetLinuxConfigPath())) {
server.config.logger.info(` ${colors.green('➜')} Using Valet certificate to secure Vite.`)
}
Comment on lines +221 to 223
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jameshulse, I've just made this change to ensure the Linux version also sees the log message in the Vite server output. Could you confirm that is working as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sure do:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}
Expand Down Expand Up @@ -580,8 +580,12 @@ function determineDevelopmentEnvironmentConfigPath(): string|undefined {
return herdWindowsConfigPath()
}

if (fs.existsSync(valetConfigPath())) {
return valetConfigPath()
if (fs.existsSync(valetMacConfigPath())) {
return valetMacConfigPath()
}

if (fs.existsSync(valetLinuxConfigPath())) {
return valetLinuxConfigPath()
}
}

Expand Down Expand Up @@ -622,8 +626,15 @@ 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')
}

/**
* Valet Linux's configuration directory.
*/
function valetLinuxConfigPath(): string {
return path.resolve(os.homedir(), '.valet')
}
Loading