fixed LANGUAGE only env variable

This commit is contained in:
shimanekb 2015-08-22 23:00:41 -05:00
parent 123bfd61b2
commit e972e10cea

View file

@ -90,14 +90,22 @@
[] []
(or (getenv "LEIN_GPG") "gpg")) (or (getenv "LEIN_GPG") "gpg"))
(defn- get-english-env []
"Returns environment variables as a map with clojure keywords and LANGUAGE set to 'en'"
(let [env (System/getenv)
keywords (map #(keyword %) (keys env))]
(merge (zipmap keywords (vals env))
{:LANGUAGE "en"})))
(defn gpg (defn gpg
"Shells out to (gpg-program) with the given arguments" "Shells out to (gpg-program) with the given arguments"
[& args] [& args]
(let [env (get-english-env)]
(try (try
(shell/with-sh-env {:LANGUAGE "en"} (shell/with-sh-env env
(apply shell/sh (gpg-program) args)) (apply shell/sh (gpg-program) args))
(catch java.io.IOException e (catch java.io.IOException e
{:exit 1 :err (.getMessage e)}))) {:exit 1 :err (.getMessage e)}))))
(defn gpg-available? (defn gpg-available?
"Verifies (gpg-program) exists" "Verifies (gpg-program) exists"