functional service
This commit is contained in:
parent
65d3dee18b
commit
da7d41cfa6
1 changed files with 7 additions and 3 deletions
10
service.nix
10
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}"
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue