-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommon.js
More file actions
47 lines (42 loc) · 1 KB
/
common.js
File metadata and controls
47 lines (42 loc) · 1 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const path = require('path');
const os = require('os');
function getLocations() {
const funcvmDir = path.join(os.homedir(), '.funcvm');
const downloadDir = path.join(funcvmDir, 'download');
return {
funcvmDir,
downloadDir,
};
}
function getPlatform() {
switch (os.platform()) {
case 'win32':
return {
os: 'Windows',
arch: 'x64',
label: 'win-x64',
};
case 'darwin':
return {
os: 'MacOS',
arch: 'x64',
label: 'osx-x64',
};
case 'linux':
return {
os: 'Linux',
arch: 'x64',
label: 'linux-x64',
};
default:
throw new Error(`Unsupported platform: ${os.platform()}`);
}
}
const constants = {
versionEnvironmentVariableName: 'FUNCVM_CORE_TOOLS_VERSION',
};
module.exports = {
getLocations,
getPlatform,
constants,
};