mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-30 18:24:27 +01:00
33 lines
537 B
TypeScript
33 lines
537 B
TypeScript
|
"use strict";
|
||
|
|
||
|
import { platform, arch } from "os";
|
||
|
|
||
|
export const getPlatform = () => {
|
||
|
switch (platform()) {
|
||
|
case "aix":
|
||
|
case "freebsd":
|
||
|
case "linux":
|
||
|
case "openbsd":
|
||
|
case "android":
|
||
|
return "linux";
|
||
|
case "darwin":
|
||
|
case "sunos":
|
||
|
return "mac";
|
||
|
case "win32":
|
||
|
return "win";
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export const getArch = () => {
|
||
|
switch (arch()) {
|
||
|
case "x64":
|
||
|
return "x64";
|
||
|
case "x32":
|
||
|
return "x86";
|
||
|
case "arm":
|
||
|
return "arm";
|
||
|
case "arm64":
|
||
|
return "arm64";
|
||
|
}
|
||
|
};
|