From 740126366495815b6f173bc15ba298ab802bf1d3 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Thu, 23 Jan 2025 18:29:47 +0000 Subject: [PATCH] Expand file names before loading --- modules/ordo/cli.scm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/ordo/cli.scm b/modules/ordo/cli.scm index 8312ccb..64241e6 100644 --- a/modules/ordo/cli.scm +++ b/modules/ordo/cli.scm @@ -1,4 +1,5 @@ (define-module (ordo cli) + #:use-module (ice-9 filesystem) #:use-module (ice-9 match) #:use-module (logging logger) #:use-module (ordo logger) @@ -9,12 +10,14 @@ (define (main args) (match-let (((_ inventory-path playbook-path) args)) - (setup-logging #:level 'DEBUG) - (log-msg 'DEBUG "Initializing context") - (init-context!) - (load inventory-path) - (log-msg 'DEBUG "Loaded inventory: " inventory-path) - (let ((playbook (load playbook-path))) - (log-msg 'DEBUG "Loaded playbook: " playbook-path) - (run-playbook playbook)) - (quit))) + (let ((inventory-path (expand-file-name inventory-path)) + (playbook-path (expand-file-name playbook-path))) + (setup-logging #:level 'DEBUG) + (log-msg 'DEBUG "Initializing context") + (init-context!) + (load inventory-path) + (log-msg 'DEBUG "Loaded inventory: " inventory-path) + (let ((playbook (load playbook-path))) + (log-msg 'DEBUG "Loaded playbook: " playbook-path) + (run-playbook playbook)) + (quit))))