Skip to content

Commit

Permalink
Fix parsing of solana network from env
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisses committed Nov 21, 2023
1 parent 11842e4 commit 9b2ac16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nosana_node/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
[clojure.tools.cli :as cli]))

(defn get-env-fn
([e default parse-fn] (fn [_] (let [env (System/getenv e)]
(if env
(parse-fn env)
default))))
([e default] (fn [_] (or (System/getenv e) default)))
([e] (fn [_] (System/getenv e))))

Expand All @@ -27,7 +31,7 @@
:default-fn (get-env-fn "NOSANA_NFT")
:id :nft]
["-n" "--network NETWORK" "Solana network to run on (mainnet or devnet)"
:default-fn (get-env-fn "SOLANA_NETWORK" :devnet)
:default-fn (get-env-fn "SOLANA_NETWORK" :mainnet)
:parse-fn #(keyword %)
:id :solana-network]
["-w" "--wallet PATH" "Path to wallet private key"
Expand Down

0 comments on commit 9b2ac16

Please sign in to comment.