Skip to content

Commit

Permalink
fix list sort really
Browse files Browse the repository at this point in the history
  • Loading branch information
iesahin committed Dec 29, 2023
1 parent f97aa7e commit f0e0acd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion book/src/ref/xvc-pipeline-step-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ $ xvc pipeline step new --step-name world --command "echo world" --when always

```console
$ xvc pipeline step list
hello: echo hello (by_dependencies)
world: echo world (always)
hello: echo hello (by_dependencies)

```

Expand Down
7 changes: 3 additions & 4 deletions pipeline/src/pipeline/api/step_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ pub fn cmd_step_list(

xvc_root
.with_r1nstore(|rs: &R1NStore<XvcPipeline, XvcStep>| {
let steps: HStore<XvcStep> =
rs.children_of(&pipeline_e)?.into_iter().sorted().collect();
let steps: HStore<XvcStep> = rs.children_of(&pipeline_e)?;

if names_only {
for (_, step) in steps {
for (_, step) in steps.into_iter().sorted() {
output!(output_snd, "{}", step);
}
} else {
let bs_command = xvc_root.load_store::<XvcStepCommand>()?;
let bs_invalidate = xvc_root.load_store::<XvcStepInvalidate>()?;

for (step_e, step) in steps {
for (step_e, step) in steps.into_iter().sorted() {
let command = &bs_command[&step_e];
let invalidate = bs_invalidate.get(&step_e).cloned().unwrap_or_default();
output!(output_snd, "{}: {} ({})", step, command, invalidate);
Expand Down

0 comments on commit f0e0acd

Please sign in to comment.