Fix list subcommand not listing global dir without a local dir

This commit is contained in:
Filip Tibell 2023-09-25 12:41:56 -05:00
parent fbee7c85bd
commit 2e53cdcad7
No known key found for this signature in database
2 changed files with 10 additions and 14 deletions

View file

@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### 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 `net.serve` stopping when the returned `ServeHandle` is garbage collected
- Fixed missing trailing newline when using the `warn` global - 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]) - Fixed constructor for `CFrame` in the `roblox` built-in library not parsing the 12-arg overload correctly. ([#102])

View file

@ -83,20 +83,15 @@ impl Cli {
// List files in `lune` and `.lune` directories, if wanted // List files in `lune` and `.lune` directories, if wanted
// This will also exit early and not run anything else // This will also exit early and not run anything else
if self.list { if self.list {
let sorted_relative = match find_lune_scripts(false).await { let sorted_relative = find_lune_scripts(false).await.map(sort_lune_scripts);
Ok(scripts) => sort_lune_scripts(scripts), let sorted_home_dir = find_lune_scripts(true).await.map(sort_lune_scripts);
Err(e) => { if sorted_relative.is_err() && sorted_home_dir.is_err() {
eprintln!("{e}"); eprintln!("{}", sorted_relative.unwrap_err());
return Ok(ExitCode::FAILURE); return Ok(ExitCode::FAILURE);
} }
};
let sorted_home_dir = match find_lune_scripts(true).await { let sorted_relative = sorted_relative.unwrap_or(Vec::new());
Ok(scripts) => sort_lune_scripts(scripts), let sorted_home_dir = sorted_home_dir.unwrap_or(Vec::new());
Err(e) => {
eprintln!("{e}");
return Ok(ExitCode::FAILURE);
}
};
let mut buffer = String::new(); let mut buffer = String::new();
if !sorted_relative.is_empty() { if !sorted_relative.is_empty() {