From ac3a251f5c3c0321050689aa2e6085c237640ad0 Mon Sep 17 00:00:00 2001 From: Cornelius Mika Date: Thu, 17 Aug 2017 10:16:26 +0200 Subject: [PATCH] home-manager: show full script path on activation error Run the activation script in its original nix-store location so that Bash error messages show the real script location instead of 'wrkdir', which gets deleted right after the script exits. --- home-manager/home-manager | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index f599d9008..45fe0e1cb 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -91,8 +91,9 @@ function doSwitch() { local wrkdir wrkdir="$(mktemp -d)" + local generation local exitCode=0 - doBuild "$wrkdir/generation" && "$wrkdir/generation/activate" || exitCode=1 + generation=$(doBuild "$wrkdir/result") && $generation/activate || exitCode=1 # Because the previous command never fails, the script keeps running and # $wrkdir is always removed.