diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-11-01 13:37:49 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-11-01 13:37:49 -0400 |
| commit | 4d63a9f0ad327cba305e239e51d02e5e33213eda (patch) | |
| tree | 71622cb0261977dd02864bd14996717adb55c99d /src/Propellor/PrivData.hs | |
| parent | 9c4ee2a6d299a24ff83cbb4cd04a2a402bccb78d (diff) | |
run editor processes in foreground
Diffstat (limited to 'src/Propellor/PrivData.hs')
| -rw-r--r-- | src/Propellor/PrivData.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs index e59f42c3..6b77f782 100644 --- a/src/Propellor/PrivData.hs +++ b/src/Propellor/PrivData.hs @@ -54,6 +54,8 @@ import Utility.FileMode import Utility.Env import Utility.Table import Utility.FileSystemEncoding +import Utility.ConcurrentOutput +import Utility.Process -- | Allows a Property to access the value of a specific PrivDataField, -- for use in a specific Context or HostContext. @@ -192,7 +194,8 @@ editPrivData field context = do hClose th maybe noop (\p -> writeFileProtected' f (`L.hPut` privDataByteString p)) v editor <- getEnvDefault "EDITOR" "vi" - unlessM (boolSystem editor [File f]) $ + (_, _, _, p) <- createProcessForeground $ proc editor [f] + unlessM (checkSuccessProcess p) $ error "Editor failed; aborting." PrivData <$> readFile f setPrivDataTo field context v' |
