From 5b14fdf85a5f19cd2ca1ae2fc5b56b0308049f7c Mon Sep 17 00:00:00 2001 From: Andrea Amantini Date: Mon, 8 Apr 2024 18:32:25 +0200 Subject: [PATCH] CLI: Fix restart command from subdirectories --- resources/VERSION | 2 +- src/nextjournal/garden_cli.clj | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/VERSION b/resources/VERSION index c946ee6..1180819 100644 --- a/resources/VERSION +++ b/resources/VERSION @@ -1 +1 @@ -0.1.6 +0.1.7 diff --git a/src/nextjournal/garden_cli.clj b/src/nextjournal/garden_cli.clj index 11ade5b..2458ea2 100755 --- a/src/nextjournal/garden_cli.clj +++ b/src/nextjournal/garden_cli.clj @@ -280,7 +280,11 @@ (call-api (assoc opts :command "logs" :as :stream))) (defn restart [{:keys [opts]}] - (call-api (assoc opts :command "restart" :as :stream))) + (let [working-dir (path-from-git-root-parent)] + (call-api (-> opts + (assoc :command "restart" :as :stream) + (cond-> working-dir + (assoc :working-dir working-dir)))))) (defn stop [m] (let [{:keys [ok message]} (call-api (merge {:command "stop"} (:opts m)))]