diff --git a/service.nix b/service.nix index 35ebe1b..7df7a9b 100644 --- a/service.nix +++ b/service.nix @@ -15,7 +15,9 @@ in let execName = service; script = writeShellScriptBin execName '' - set -xv + clone_repo() { + git clone "$1" "$2" + } while IFS="" read -r p || [ -n "$p" ] do @@ -25,10 +27,12 @@ in if [ -d "$target" ]; then if ${pkgs.findutils}/bin/find "$target" -maxdepth 0 -empty | read v; then - echo "~ No Files in $target ~" + clone_repo "$repo" "$target" else - echo "~ Found Files at $target ~" + echo "Files already found: $target" fi + else + clone_repo "$repo" "$target" fi done < "${config.repo-clone.pkg}" '';