-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmkcert.js
More file actions
33 lines (26 loc) · 913 Bytes
/
mkcert.js
File metadata and controls
33 lines (26 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//////////////////////////////////////////////////////////////////////
//
// Exports three constants:
//
// - version: the mkcert binary version
// - binaryName: the mkcert binary name
// - binaryPath: the path to the binary for this machine.
//
//////////////////////////////////////////////////////////////////////
import os from 'os'
export const version = '1.4.3'
const platformMap = {
linux: 'linux',
darwin: 'darwin',
win32: 'windows'
}
const architectureMap = {
arm: 'arm',
arm64: 'arm64',
x64: 'amd64'
}
const platform = platformMap[os.platform()]
const architecture = architectureMap[os.arch()]
if (platform === undefined) throw new Error('Unsupported platform', os.platform())
if (architecture === undefined) throw new Error('Unsupported architecture', os.arch())
export const binaryName = `mkcert-v${version}-${platform}-${architecture}${platform === 'windows' ? '.exe' : ''}`