Skip to content

Commit

Permalink
print only the source files
Browse files Browse the repository at this point in the history
Signed-off-by: Alpha DIALLO <[email protected]>
  • Loading branch information
moyodiallo committed Jan 31, 2024
1 parent f285731 commit df00bbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/dune_engine/diff_promotion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,6 @@ let display_files files_to_promote =
file_opts
|> List.filter_opt
|> List.sort ~compare:(fun file file' -> File.compare file file')
|> List.map ~f:File.to_dyn
|> List.iter ~f:(fun file -> Console.print [ Dyn.pp file ])
|> List.iter ~f:(fun (file : File.t) ->
Console.printf "%s" (Path.Source.to_string file.dst))
;;
20 changes: 4 additions & 16 deletions test/blackbox-tests/test-cases/promote/promotion-list.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,12 @@
[1]

$ dune promotion list --diff-command 'diff -u' 2>&1
{ src = In_build_dir "default/a.actual"
; staging = None
; dst = In_source_tree "a.expected"
}
{ src = In_build_dir "default/b.actual"
; staging = Some In_build_dir ".promotion-staging/b.expected"
; dst = In_source_tree "b.expected"
}
a.expected
b.expected

$ dune promotion list b.expected --diff-command 'diff -u' 2>&1
{ src = In_build_dir "default/b.actual"
; staging = Some In_build_dir ".promotion-staging/b.expected"
; dst = In_source_tree "b.expected"
}
b.expected

$ dune promotion list a.expected nothing-to-promote.txt --diff-command 'diff -u' 2>&1
Warning: Nothing to promote for nothing-to-promote.txt.
{ src = In_build_dir "default/a.actual"
; staging = None
; dst = In_source_tree "a.expected"
}
a.expected

0 comments on commit df00bbd

Please sign in to comment.