feat: Add getOS()
This commit is contained in:
parent
4b6109cfb2
commit
86eb62d73e
5 changed files with 35 additions and 26 deletions
13
lib/get-os.js
Normal file
13
lib/get-os.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue