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
|
let
|
||||||
execName = service;
|
execName = service;
|
||||||
script = writeShellScriptBin execName ''
|
script = writeShellScriptBin execName ''
|
||||||
set -xv
|
clone_repo() {
|
||||||
|
git clone "$1" "$2"
|
||||||
|
}
|
||||||
|
|
||||||
while IFS="" read -r p || [ -n "$p" ]
|
while IFS="" read -r p || [ -n "$p" ]
|
||||||
do
|
do
|
||||||
|
@ -25,10 +27,12 @@ in
|
||||||
|
|
||||||
if [ -d "$target" ]; then
|
if [ -d "$target" ]; then
|
||||||
if ${pkgs.findutils}/bin/find "$target" -maxdepth 0 -empty | read v; then
|
if ${pkgs.findutils}/bin/find "$target" -maxdepth 0 -empty | read v; then
|
||||||
echo "~ No Files in $target ~"
|
clone_repo "$repo" "$target"
|
||||||
else
|
else
|
||||||
echo "~ Found Files at $target ~"
|
echo "Files already found: $target"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
clone_repo "$repo" "$target"
|
||||||
fi
|
fi
|
||||||
done < "${config.repo-clone.pkg}"
|
done < "${config.repo-clone.pkg}"
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue