functional service

main
Zynh Ludwig 2024-08-01 03:50:08 -07:00
parent 65d3dee18b
commit da7d41cfa6
1 changed files with 7 additions and 3 deletions

View File

@ -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}"
'';