Fix lint error in OS.ts
This commit is contained in:
parent
53a471b2b1
commit
925e02e397
1 changed files with 5 additions and 6 deletions
11
ts/OS.ts
11
ts/OS.ts
|
@ -5,12 +5,11 @@ import semver from 'semver';
|
|||
export const isMacOS = () => process.platform === 'darwin';
|
||||
export const isLinux = () => process.platform === 'linux';
|
||||
export const isWindows = (minVersion?: string) => {
|
||||
if (process.platform !== 'win32') return false;
|
||||
|
||||
const osRelease = os.release();
|
||||
const isVersionValid = is.undefined(minVersion)
|
||||
? true
|
||||
: semver.gte(osRelease, minVersion);
|
||||
|
||||
return isVersionValid;
|
||||
if (process.platform !== 'win32') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return is.undefined(minVersion) ? true : semver.gte(osRelease, minVersion);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue