13 lines
316 B
JavaScript
13 lines
316 B
JavaScript
function getOS(platform) {
|
|
if (platform === "linux") {
|
|
return "Linux";
|
|
} else if (platform === "darwin") {
|
|
return "macOS";
|
|
} else if (platform === "win32") {
|
|
throw new Error("Windows is not supported");
|
|
} else {
|
|
throw new Error(`${platform} is not supported`);
|
|
}
|
|
}
|
|
|
|
module.exports = getOS;
|