Skip to content

Commit

Permalink
Cache github auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
julienvincent committed Oct 29, 2023
1 parent 912ebde commit e443251
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/k16/kl/api/github.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

(set! *warn-on-reflection* true)

(def ^:private cached-auth-token
(delay
(let [res (proc/sh ["gh" "auth" "token"])]
(-> res :out str/trim))))

(defn- get-auth-token []
(let [res (proc/sh ["gh" "auth" "token"])]
(-> res :out str/trim)))
@cached-auth-token)

(defn request [{:keys [path headers]}]
(let [res
Expand Down

0 comments on commit e443251

Please sign in to comment.