-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial try at a Mac implementation #1
base: main
Are you sure you want to change the base?
Conversation
How do I test my code, running [error] /Users/zeta/dev/scala/dirs/core/shared/src/main/scala/tf/bug/dirs/Dirs.scala:14:31: not found: value WindowsPlatform
[error] lazy val windows: Windows = WindowsPlatform
[error] ^
[error] /Users/zeta/dev/scala/dirs/core/shared/src/main/scala/tf/bug/dirs/Dirs.scala:15:23: not found: value MacPlatform
[error] lazy val mac: Mac = MacPlatform
[error] ^
[error] two errors found
[error] /Users/zeta/dev/scala/dirs/core/shared/src/main/scala/tf/bug/dirs/Dirs.scala:14:31: not found: value WindowsPlatform
[error] lazy val windows: Windows = WindowsPlatform
[error] ^
[error] one error found |
I don't actually have a unit test framework set up, that I think you specifically have to run it on the platform you're targeting. (Really, it should end up being removed, or moved to the |
val osName = System.getProperty("os.name") | ||
if (osName.contains("Windows")) { | ||
Platform.Windows | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contains("Mac") || contains("Darwin")
? Not sure if darwin
will report lower-case here though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the "Mac" part by runninggetProperty
locally.
AFAIK, os.name
never returns "darwin". However only evidence I can find is are blogposts.
Looks great! Once I figure out how to run only specific targets (so we don't have to worry about Native yet), if it works I'll merge. |
Thank you! I'll add Linux when I have access to a Linux box again. |
The implementation is 99% based off of
dirs-rs
package! :P