summaryrefslogtreecommitdiff
path: root/fsmgr.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-05-27 21:58:55 -0400
committerAndrew Cady <d@jerkface.net>2020-05-27 22:48:46 -0400
commit694309e7cae73b7f428238fc51242d1804c1cf4a (patch)
tree08ffcad6e55f11276371672a8174cb5c1e2c5701 /fsmgr.hs
parent1fc23d6d26a25557b5c5ef1a204ef573421f2706 (diff)
handle case where $SUDO_USER is not set
Diffstat (limited to 'fsmgr.hs')
-rw-r--r--fsmgr.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/fsmgr.hs b/fsmgr.hs
index 3a59a53..ca80f8a 100644
--- a/fsmgr.hs
+++ b/fsmgr.hs
@@ -122,7 +122,7 @@ absPath f = do
122 122
123getHomeDir :: Action FilePath 123getHomeDir :: Action FilePath
124getHomeDir = do 124getHomeDir = do
125 Stdout homeDir <- cmd ["sh", "-c", "getent passwd \"$SUDO_USER\"|(IFS=: read _ _ _ _ _ d _; printf %s \"$d\")"] 125 Stdout homeDir <- cmd "sh -c" ["if [ \"$SUDO_USER\" ]; then getent passwd \"$SUDO_USER\" | cut -d: -f6; else printf \"%s\n\" \"$HOME\"; fi"]
126 return homeDir 126 return homeDir
127 127
128buildInitialImage :: DiskImageConfig -> FilePath -> FilePath -> Action () 128buildInitialImage :: DiskImageConfig -> FilePath -> FilePath -> Action ()