From 563f078e0443a134585ffe96506a41ac3533ac92 Mon Sep 17 00:00:00 2001 From: Jakub Turski Date: Sun, 8 Dec 2024 20:25:40 +0000 Subject: [PATCH] fix: handle non-systemd environments for chassisType --- home/.chezmoi.yaml.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.chezmoi.yaml.tmpl b/home/.chezmoi.yaml.tmpl index 545c733..fc3a874 100644 --- a/home/.chezmoi.yaml.tmpl +++ b/home/.chezmoi.yaml.tmpl @@ -7,4 +7,4 @@ merge: - "{{"{{"}} .Source {{"}}"}}" - "{{"{{"}} .Target {{"}}"}}" data: - chassisType: {{ (output "hostnamectl" "--json=short" | mustFromJson).Chassis }} + chassisType: {{ if lookPath "hostnamectl" }}{{ (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}{{ else }}unknown{{ end }}