diff --git a/CHANGELOG.md b/CHANGELOG.md index 934cc67..25234ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed list subcommand not listing global scripts without a local `.lune` / `lune` directory present - Fixed `net.serve` stopping when the returned `ServeHandle` is garbage collected - Fixed missing trailing newline when using the `warn` global - Fixed constructor for `CFrame` in the `roblox` built-in library not parsing the 12-arg overload correctly. ([#102]) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index ccc11ae..9a80c9d 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -83,20 +83,15 @@ impl Cli { // List files in `lune` and `.lune` directories, if wanted // This will also exit early and not run anything else if self.list { - let sorted_relative = match find_lune_scripts(false).await { - Ok(scripts) => sort_lune_scripts(scripts), - Err(e) => { - eprintln!("{e}"); - return Ok(ExitCode::FAILURE); - } - }; - let sorted_home_dir = match find_lune_scripts(true).await { - Ok(scripts) => sort_lune_scripts(scripts), - Err(e) => { - eprintln!("{e}"); - return Ok(ExitCode::FAILURE); - } - }; + let sorted_relative = find_lune_scripts(false).await.map(sort_lune_scripts); + let sorted_home_dir = find_lune_scripts(true).await.map(sort_lune_scripts); + if sorted_relative.is_err() && sorted_home_dir.is_err() { + eprintln!("{}", sorted_relative.unwrap_err()); + return Ok(ExitCode::FAILURE); + } + + let sorted_relative = sorted_relative.unwrap_or(Vec::new()); + let sorted_home_dir = sorted_home_dir.unwrap_or(Vec::new()); let mut buffer = String::new(); if !sorted_relative.is_empty() {