Skip to content

Commit

Permalink
fix: System.Posix.User.getGroupEntryForName does not exist on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lrworth committed Sep 4, 2023
1 parent 985e43b commit 2e8aa43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dhall/src/Dhall/DirectoryTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,13 @@ getUser (UserName name) =
-- | Resolve a `Group` to a numerical id.
getGroup :: Group -> IO GroupID
getGroup (GroupId gid) = return gid
getGroup (GroupName name) = Posix.groupID <$> Posix.getGroupEntryForName name
getGroup (GroupName name) =
#ifdef mingw32_HOST_OS
ioError $ mkIOError illegalOperationErrorType x Nothing Nothing
where x = "System.Posix.User.getGroupEntryForName: not supported"
#else
Posix.groupID <$> Posix.getGroupEntryForName name
#endif

-- | Process a `FilesystemEntry`. Writes the content to disk and apply the
-- metadata to the newly created item.
Expand Down

0 comments on commit 2e8aa43

Please sign in to comment.