Skip to content

Commit 1a4f79c

Browse files
committed
feat: check if anything exists before mkdir - quadlets
Signed-off-by: Reputable2722 <153411261+Reputable2772@users.noreply.github.com>
1 parent baa4c28 commit 1a4f79c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/Home-Manager/quadlets.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ let
4747
v.Container.Volume
4848
|> map (x: builtins.elemAt (builtins.split ":" x) 0)
4949
|> filter (x: !(hasSuffix ".volume" x))
50-
|> concatMapStringsSep "\n" (x: "${pkgs.coreutils}/bin/mkdir -p ${x}")
51-
|> pkgs.writeShellScript "${n}-mkdir"
50+
|> concatMapStringsSep "\n" (x: "[[ ! -e ${x} ]] && ${pkgs.coreutils}/bin/mkdir -p ${x}")
51+
|> (a: pkgs.writeShellScript "${n}-mkdir" (a + "\nexit 0\n"))
5252
)
5353
];
5454
}

0 commit comments

Comments
 (0)