From 14083a085771ef218cef5f4b5df4c95b65e6e319 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 5 Nov 2017 19:31:07 +0100 Subject: [PATCH] home-manager: refuse build if CWD is read-only This produces a clearer error message than produced by Nix. Fixes #116. --- home-manager/home-manager | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home-manager/home-manager b/home-manager/home-manager index d3ef4dfc..7161f171 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -113,6 +113,11 @@ function presentNews() { } function doBuild() { + if [[ ! -w . ]]; then + errorEcho "Cannot run build in read-only directory"; + return 1 + fi + local newsInfo newsInfo=$(buildNews)