From 0acf42e813cc6c88f7c611a44bd75434d09d1dad Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 11 Feb 2025 13:03:22 -0600 Subject: [PATCH] add warning if using remote flake --- pkgs/oizys/src/oizys/context.nim | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/oizys/src/oizys/context.nim b/pkgs/oizys/src/oizys/context.nim index 6f07502..ef16a30 100644 --- a/pkgs/oizys/src/oizys/context.nim +++ b/pkgs/oizys/src/oizys/context.nim @@ -28,6 +28,15 @@ proc initContext*(): OizysContext = var oc = initContext() +proc getVerbosity*(): int = return oc.verbose.val +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 + + + proc checkPath(s: string): string = ## fail if path doesn't exist if not s.dirExists: fatalQuit fmt"flake path: {s} does not exist" @@ -50,11 +59,8 @@ proc updateContext*( else: checkPath(flake.normalizedPath().absolutePath()) debug bb(fmt"""[b]flake[/]: {oc.flake}, [b]hosts[/]: {oc.hosts.join(" ")}""") + if not isLocal(): + warn "not using local directory for flake" + -proc getVerbosity*(): int = return oc.verbose.val -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