From 2742072176a41f61e09d62e5a348726effaa1ccb Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 2 Jun 2024 21:31:52 +0200 Subject: fix(nix-sync): Add code-path to create a repo's path, if absent --- system/services/nix-sync/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/services/nix-sync') diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix index 082a8f0..b4a9803 100644 --- a/system/services/nix-sync/default.nix +++ b/system/services/nix-sync/default.nix @@ -81,7 +81,11 @@ [ "$(wc -l < "$out_paths")" -gt 1 ] && (echo "To many out-paths"; exit 1) out_path="$(cat "$out_paths")"; - [ -d ${esa repo.path} ] && rm -d ${esa repo.path}; + if [ -d ${esa repo.path} ]; then + rm -d ${esa repo.path}; + else + mkdir --parents "$(dirname ${esa repo.path})"; + fi [ -e ${esa repo.path} ] && rm ${esa repo.path}; ln -s "$out_path" ${esa repo.path}; -- cgit 1.4.1