don't lock if it's not around

This commit is contained in:
Daylin Morgan 2025-02-10 13:56:05 -06:00
parent bdd67bd00b
commit 12a0eb60ab
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 7 additions and 2 deletions

View file

@ -191,7 +191,11 @@ hwylCli:
currently just runs `jq < flake.lock '.nodes | keys[] | select(contains("_"))' -r`
"""
run:
discard runCmd("nix flake lock")
# use absolute value for flake.lock?
quitWithCmd("""jq '.nodes | keys[] | select(contains("_"))' -r flake.lock""")
if not isLocal():
quit "`oizys lock` should be run with a local flake"
discard runCmd("nix flake lock " & getFlake())
let lockfile = getFlake() / "flake.lock"
quitWithCmd(fmt"""jq '.nodes | keys[] | select(contains("_"))' -r {lockFile}""")

View file

@ -57,3 +57,4 @@ proc getHosts*(): seq[string] = return oc.hosts
proc getFlake*(): string = return oc.flake
proc isResetCache*(): bool = return oc.resetCache
proc isCi*(): bool = return oc.ci
proc isLocal*(): bool = return oc.flake.dirExists