Skip to content

Commit

Permalink
refactor!: output JSON when --porcelain is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jun 30, 2024
1 parent 2e9522e commit 6074b9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rocks-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ itertools = "0.12.1"
nucleo = "0.4.1"
octocrab = "0.36.0"
rustyline = "14.0.0"
serde_json = "1.0.118"
spdx = "0.10.4"
spinners = "4.1.1"
termcolor = "1.4.1"
Expand Down
4 changes: 1 addition & 3 deletions rocks-bin/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ pub fn list(list_data: List, config: &Config) -> Result<()> {
// TODO(vhyrro): Add `outdated` support.

if list_data.porcelain {
for (name, versions) in available_rocks {
println!("{}: {}", name, versions.join(" "));
}
println!("{}", serde_json::to_string(&available_rocks)?);
} else {
let formatting = TreeFormatting::dir_tree(FormatCharacters::box_chars());
for (name, versions) in available_rocks.into_iter().sorted() {
Expand Down

0 comments on commit 6074b9f

Please sign in to comment.