From 9dda63e446810c02ea0f89bbf1f55cd41747abba Mon Sep 17 00:00:00 2001 From: Cameron Wilby Date: Thu, 9 Feb 2023 06:03:28 -0800 Subject: [PATCH] Added support for Linux/Windows valet ports (#2) --- index.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2d13250..e01af63 100644 --- a/index.js +++ b/index.js @@ -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)) {