Cross-platform auto-launch helpers for MoonBit, inspired by Teamwork/node-auto-launch.
///|
test "public api can be called" {
ignore(@proton_auto_launch.current_platform())
ignore(@proton_auto_launch.is_supported())
let launcher = @proton_auto_launch.new(
"MoonBit Demo",
path=match @proton_auto_launch.current_platform() {
Windows => "C:\\Program Files\\MoonBit\\moonbit.exe"
Macos => "/Applications/MoonBit.app/Contents/MacOS/MoonBit"
Linux => "/usr/bin/moonbit"
Unsupported => "/unsupported"
},
launch_in_background=true,
extra_arguments=["--serve"],
)
match launcher {
Ok(value) => {
ignore(value.name())
ignore(value.path())
ignore(value.identifier())
}
Err(_) => ()
}
}type AutoLaunchConfigimpl Show for AutoLaunchErrorfn is_supported() -> Boolfn new(name : String, path? : String, launch_in_background? : Bool, background_arg? : String, extra_arguments? : Array[String], identifier? : String) -> Result[AutoLaunch, AutoLaunchError]let launcher = @proton_auto_launch.new(
"MoonBit Demo",
path="/usr/bin/moonbit",
launch_in_background=true,
extra_arguments=["--serve"],
)Cross-platform auto-launch helpers for MoonBit, inspired by Teamwork/node-auto-launch.