Skip to content

Commit

Permalink
fix: additional path escaping issue #80 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ausernamedtom authored Jan 9, 2024
1 parent 6bada0c commit 9437e15
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions plugin/mkcert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Mkcert {
}

const mkcertBinary = await this.getMkcertBinary()
const commandStatement = `${mkcertBinary} -CAROOT`
const commandStatement = `${escape(mkcertBinary)} -CAROOT`

debug(`Exec ${commandStatement}`)

Expand Down Expand Up @@ -204,7 +204,7 @@ class Mkcert {
await ensureDirExist(this.savePath)
await this.retainExistedCA()

const cmd = `${mkcertBinary} -install -key-file ${escape(
const cmd = `${escape(mkcertBinary)} -install -key-file ${escape(
this.keyFilePath
)} -cert-file ${escape(this.certFilePath)} ${names}`

Expand Down Expand Up @@ -255,13 +255,11 @@ class Mkcert {
if (!sourceInfo) {
const message =
typeof this.sourceType === 'string'
? `Unsupported platform. Unable to find a binary file for ${
process.platform
} platform with ${process.arch} arch on ${
this.sourceType === 'github'
? 'https://github.com/FiloSottile/mkcert/releases'
: 'https://liuweigl.coding.net/p/github/artifacts?hash=8d4dd8949af543159c1b5ac71ff1ff72'
}`
? `Unsupported platform. Unable to find a binary file for ${process.platform
} platform with ${process.arch} arch on ${this.sourceType === 'github'
? 'https://github.com/FiloSottile/mkcert/releases'
: 'https://liuweigl.coding.net/p/github/artifacts?hash=8d4dd8949af543159c1b5ac71ff1ff72'
}`
: 'Please check your custom "source", it seems to return invalid result'
throw new Error(message)
}
Expand Down

0 comments on commit 9437e15

Please sign in to comment.