Use an enum for OS Types
See original GitHub issueCurrent we use boolean values to determine whether os is one of Mac, Windows or Linux. Should consider using an Enum. This could result in a number of changes, however I believe it is worth, and needs to be done. Using 3 booleans doesn’t work well, when all of them are mutually exclusive.
Suggestion:
export enum OS {
Linux = 'Linux',
Mac = 'Mac',
Windows = 'Windows'
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - Representing OS as Enum - Stack Overflow
My gut was to use an enum for this representation (e.g. OS.VistaSp1, OS.Win7, etc.) but since we also support several OS types (Mac,...
Read more >Enumerations - a free Hacking with Swift tutorial
Enumerations – usually just called “enum” and pronounced “ee-num” - are a way for you to define your own kind of value in...
Read more >Enums in swift - Abhimuralidharan - Medium
An enumeration is a data type consisting of a set of named values, ... You could use the enum with defined values if...
Read more >enum in Java - GeeksforGeeks
A Java enumeration is a class type. Although we don't need need to instantiate an enum using new, it has the same capabilities...
Read more >OS (JUnit 5.2.0 API)
Enumeration of common operating systems used for testing Java applications. If the current operating system cannot be detected — for example, if the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DonJayamanne depends on what we use the enum for. 😉 I mean we won’t be able to rely on something being Windows to get the path stuff right, but VS Code will be running on Windows itself, so it’s possible we will need it. (I’m not suggesting we start with it now, just something we may need to think about in the future.)
This has been around for some time, see client/common/utils/platform.ts