Skip to content

Commit

Permalink
Fix list subcommand not listing global dir without a local dir
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Sep 25, 2023
1 parent fbee7c8 commit 2e53cdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
23 changes: 9 additions & 14 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2e53cdc

Please sign in to comment.