File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/clj/metafacture_playground Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 11(ns metafacture-playground.process
22 (:require
33 [clojure.string :as clj-str]
4+ [clojure.java.io :as io]
45 [clojure.tools.logging :as log])
56 (:import
67 (java.io File)
3132 flux)
3233 (clj-str/replace #"\| (\s *|\n *)write\(\" .*\"\) (\s *|\n *);" output)
3334 (clj-str/replace #"\| (\s *|\n *)print(\s *|\n *);" output))]
34- (Flux/main (into-array [(content->tempfile-path flux " .flux" )]))
35- (log/info " Executed flux file with Flux/main. Result in" out-path)
36- (slurp out-path)))
35+ (try
36+ (Flux/main (into-array [(content->tempfile-path flux " .flux" )]))
37+ (log/info " Executed flux file with Flux/main. Result in" out-path)
38+ (slurp out-path)
39+ (finally
40+ ; ; Remove temp files
41+ (doseq [f [inputfile transformationFile fluxfile out-path]]
42+ (try
43+ (let [file (io/file f)]
44+ (when (.exists file)
45+ (io/delete-file file true )))
46+ (catch Exception e
47+ (log/warn " Could not delete temp file:" f e))))))))
You can’t perform that action at this time.
0 commit comments