Skip to content

Commit

Permalink
[FLINK-17687][tests] Enable listing files recursively by pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
GJL committed May 18, 2020
1 parent b591f90 commit be8c02e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flink-jepsen/src/jepsen/flink/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@
(defn find-files!
"Lists files recursively given a directory. If the directory does not exist, an empty collection
is returned."
[dir]
([dir] (find-files! dir "*"))
([dir name]
(let [files (try
(c/exec :find dir :-type :f)
(c/exec :find dir :-type :f :-name (c/lit (str "\"" name "\"")))
(catch Exception e
(if (.contains (.getMessage e) "No such file or directory")
""
(throw e))))]
(->>
(clojure.string/split files #"\n")
(remove clojure.string/blank?))))
(remove clojure.string/blank?)))))

;;; runit process supervisor (http:https://smarden.org/runit/)

Expand Down

0 comments on commit be8c02e

Please sign in to comment.