mirror of
https://github.com/Cian-H/My_NixOS_Config.git
synced 2026-08-19 08:42:52 +01:00
Fixed packages script arg parsing
This commit is contained in:
+2
-5
@@ -20,16 +20,14 @@
|
|||||||
:desc "Run auto-update after editing"}
|
:desc "Run auto-update after editing"}
|
||||||
:help {:alias :h :coerce :boolean :desc "Show this help message"}}})
|
:help {:alias :h :coerce :boolean :desc "Show this help message"}}})
|
||||||
|
|
||||||
(let [parsed (cli/parse-opts *command-line-args* cli-spec)
|
(let [opts (cli/parse-opts *command-line-args* cli-spec)]
|
||||||
opts (:opts parsed)]
|
|
||||||
|
|
||||||
(when (:help opts)
|
(when (:help opts)
|
||||||
(println "Usage: just packages [OPTIONS]")
|
(println "Usage: just packages [OPTIONS]")
|
||||||
(println (cli/format-opts cli-spec))
|
(println (cli/format-opts cli-spec))
|
||||||
(System/exit 0))
|
(System/exit 0))
|
||||||
|
|
||||||
(let [
|
(let [sys (let [s (:sys opts)]
|
||||||
sys (let [s (:sys opts)]
|
|
||||||
(if (str/blank? s) (get-hostname) s))
|
(if (str/blank? s) (get-hostname) s))
|
||||||
target (if (:home opts)
|
target (if (:home opts)
|
||||||
(str "home-manager/" sys "/packages.nix")
|
(str "home-manager/" sys "/packages.nix")
|
||||||
@@ -41,7 +39,6 @@
|
|||||||
(println (str ">> Error: Target file does not exist: " target))
|
(println (str ">> Error: Target file does not exist: " target))
|
||||||
(println ">> Please ensure this system profile has been bootstrapped or configured first."))
|
(println ">> Please ensure this system profile has been bootstrapped or configured first."))
|
||||||
(System/exit 1))
|
(System/exit 1))
|
||||||
|
|
||||||
(do
|
(do
|
||||||
(println ">> Editing" target "...")
|
(println ">> Editing" target "...")
|
||||||
(shell "just" "edit" target)
|
(shell "just" "edit" target)
|
||||||
|
|||||||
Reference in New Issue
Block a user