Skip to content

Commit 3e84e7d

Browse files
committed
Fix path with spaces on linux
1 parent d795340 commit 3e84e7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

certs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,18 @@ function mkcert(appDataPath, exe, domain) {
7979
// use apex on Windows
8080
if (process.platform === "win32")
8181
return "\"" + path + "\""
82-
// escape spaces (not already escaped) in Mac OS
83-
if (process.platform === "darwin")
82+
// escape spaces (not already escaped)
83+
if (process.platform === "darwin" || process.platform === "linux")
8484
return path.replace(/(?<!\\) /g, "\\ ")
8585
return path
8686
}
8787

88-
const logPath = path.join(appDataPath, "mkcert.log") // do not escape: fs.writeFile doesn't want an escaped path
89-
const errPath = path.join(appDataPath, "mkcert.err") // do not escape: fs.writeFile doesn't want an escaped path
9088
const exePath = ensureValidPath(path.join(appDataPath, exe))
9189
const crtPath = ensureValidPath(path.join(appDataPath, domain + ".crt"))
9290
const keyPath = ensureValidPath(path.join(appDataPath, domain + ".key"))
91+
// do not escape: fs.writeFile doesn't want an escaped path
92+
const logPath = path.join(appDataPath, "mkcert.log")
93+
const errPath = path.join(appDataPath, "mkcert.err")
9394

9495
const cmd = exePath + " -install -cert-file " + crtPath +
9596
" -key-file " + keyPath + " " + domain

0 commit comments

Comments
 (0)