From a9da4575f580778e44781bedaf5a33bd6f972219 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 14 May 2017 14:01:10 +0200 Subject: [PATCH] home-environment: run file collision check in function --- modules/home-environment.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 3b62b77f4..e58f93241 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -271,9 +271,14 @@ in ''; in '' - newGenFiles="$(readlink -e "$newGenPath/home-files")" - find "$newGenFiles" -type f -print0 -or -type l -print0 \ - | xargs -0 bash ${check} "$newGenFiles" + function checkNewGenCollision() { + local newGenFiles + newGenFiles="$(readlink -e "$newGenPath/home-files")" + find "$newGenFiles" -type f -print0 -or -type l -print0 \ + | xargs -0 bash ${check} "$newGenFiles" + } + + checkNewGenCollision || exit 1 '' );