A Moonbit equivalent of Unix command "which". Locate installed executable in cross platforms.
moon update
moon add FrenchPicnic/which /// Locate the path of 'moon'
let pth = @which.which?("moon")
match pth {
Ok(x) => println(x)
Err(e) => println(e)
} moon run xxx.mbt --target native pub enum WhichError {
PathNotFound(String)
UnknownPlatform(String)
UnSupportedPlatform(String)
FileNotFound(String)
}impl Show for WhichErrorInstall
Download zipA Moonbit equivalent of Unix command "which". Locate installed executable in cross platforms.