Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Added support for Linux/Windows valet ports (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwilby authored Feb 9, 2023
1 parent 80597e4 commit 9dda63e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,23 @@ class LaravelMixValet {
}

loadCert(ext) {
let dir;

if (process.platform === 'linux') {
dir = '.valet';
}

if (['darwin', 'win32'].includes(process.platform)) {
dir = '.config/valet';
}

if (!dir) {
throw new Error(`Unsupported platform: ${process.platform}`);
}

const cert = path.resolve(
process.env.HOME,
`.config/valet/Certificates/${this.config.host}.${ext}`
`${dir}/Certificates/${this.config.host}.${ext}`
);

if (!fs.existsSync(cert)) {
Expand Down

0 comments on commit 9dda63e

Please # to comment.