diff --git a/.gitignore b/.gitignore index 9b1c5e8..0848cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ .lein-failures /pom.xml .lein-repl-history +.cache +.clj-kondo/babashka +.clj-kondo/rewrite-clj diff --git a/CHANGELOG.md b/CHANGELOG.md index 7104147..a071a08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- [#63](https://github.com/babashka/pods/issues/63): create directory before un-tarring + ## v0.2.0 - [#61](https://github.com/babashka/pods/issues/61): add transit as explicit JVM dependency diff --git a/src/babashka/pods/impl/resolver.clj b/src/babashka/pods/impl/resolver.clj index 61a170e..a6662f5 100644 --- a/src/babashka/pods/impl/resolver.clj +++ b/src/babashka/pods/impl/resolver.clj @@ -91,7 +91,10 @@ ^"[Ljava.nio.file.CopyOption;" (into-array [java.nio.file.StandardCopyOption/REPLACE_EXISTING]))) - (sh "tar" "xf" (.getPath tmp-file) "--directory" (.getPath destination-dir)) + (.mkdirs destination-dir) + (let [res (sh "tar" "xf" (.getPath tmp-file) "--directory" (.getPath destination-dir))] + (when-not (zero? (:exit res)) + (throw (ex-info (:err res) res)))) (.delete tmp-file))) (defn make-executable [dest-dir executables verbose?] @@ -208,7 +211,7 @@ (cond (str/ends-with? filename ".zip") (unzip {:zip-file cache-file :destination-dir ddir - :verbose false}) + :verbose true}) (or (str/ends-with? filename ".tgz") (str/ends-with? filename ".tar.gz")) (un-tgz cache-file ddir