mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Netlify shouldn't build the editor
...and anyway it can't, because it's missing the xcb-shape and xcb-xfixes libraries.
This commit is contained in:
parent
3684488629
commit
d7b64b000d
2 changed files with 16 additions and 5 deletions
|
@ -19,7 +19,7 @@ fn main() -> io::Result<()> {
|
|||
|
||||
let exit_code = match matches.subcommand_name() {
|
||||
None => {
|
||||
roc_editor::launch(&[])?;
|
||||
launch_editor(&[])?;
|
||||
|
||||
// rustc couldn't infer the error type here
|
||||
Result::<i32, io::Error>::Ok(0)
|
||||
|
@ -52,14 +52,14 @@ fn main() -> io::Result<()> {
|
|||
.values_of_os(DIRECTORY_OR_FILES)
|
||||
{
|
||||
None => {
|
||||
roc_editor::launch(&[])?;
|
||||
launch_editor(&[])?;
|
||||
}
|
||||
Some(values) => {
|
||||
let paths = values
|
||||
.map(|os_str| Path::new(os_str))
|
||||
.collect::<Vec<&Path>>();
|
||||
|
||||
roc_editor::launch(&paths)?;
|
||||
launch_editor(&paths)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,3 +86,13 @@ fn main() -> io::Result<()> {
|
|||
|
||||
std::process::exit(exit_code);
|
||||
}
|
||||
|
||||
#[cfg(feature = "editor")]
|
||||
fn launch_editor(filepaths: &[&Path]) -> io::Result<()> {
|
||||
roc_editor::launch(filepaths)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "editor"))]
|
||||
fn launch_editor(_filepaths: &[&Path]) -> io::Result<()> {
|
||||
panic!("Cannot launch the editor because this build of roc did not include `feature = \"editor\"`!");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue