on master help sign in
Merge pull request #740 from mightybyte/windows-compat

Use unix-compat instead of unix for windows compat

commitdb6b8865d26887b65e25e4897bbaf81fc44af288 authorElliot Cameron <3noch@users.noreply.github.com> dateWed 20 May 2020, 02:31 (6 years ago) parent05a2cc78c07b21
10 files changed+13−12
lib/asset/manifest/obelisk-asset-manifest.cabal+1−1 lib/asset/manifest/src/Obelisk/Asset/Symlink.hs+1−1 lib/asset/serve-snap/obelisk-asset-serve-snap.cabal+1−1 lib/asset/serve-snap/src/Obelisk/Asset/Serve/Snap.hs+1−1 lib/command/obelisk-command.cabal+1−1 lib/command/src/Obelisk/Command.hs+3−2 lib/command/src/Obelisk/Command/Deploy.hs+1−1 lib/command/src/Obelisk/Command/Project.hs+3−2 lib/command/src/Obelisk/Command/Thunk.hs+1−1 lib/snap-extras/obelisk-snap-extras.cabal−1
lib/asset/manifest/obelisk-asset-manifest.cabal+1−1
@@ -24,7 +24,7 @@ library
2424 , template-haskell
2525 , text
2626 , transformers
27− , unix
27+ , unix-compat
2828 , vector
2929 exposed-modules:
3030 Obelisk.Asset.Gather
lib/asset/manifest/src/Obelisk/Asset/Symlink.hs+1−1
@@ -7,7 +7,7 @@ import Data.Map (Map)
77import qualified Data.Map as Map
88import System.Directory
99import System.FilePath.Posix
10−import System.Posix.Files
10+import System.PosixCompat.Files
1111
1212-- | Copy the given hashed files from one location to hashed paths in another
1313-- location, and symlink the unhashed paths to the hashed ones
lib/asset/serve-snap/obelisk-asset-serve-snap.cabal+1−1
@@ -23,7 +23,7 @@ library
2323 , obelisk-snap-extras
2424 , text
2525 , transformers
26− , unix
26+ , unix-compat
2727 exposed-modules:
2828 Obelisk.Asset.Accept
2929 Obelisk.Asset.Serve.Snap
lib/asset/serve-snap/src/Obelisk/Asset/Serve/Snap.hs+1−1
@@ -31,7 +31,7 @@ import Data.Text.Encoding (decodeUtf8, encodeUtf8)
3131import System.Directory (getDirectoryContents)
3232import System.FilePath ((</>), splitFileName, takeDirectory)
3333import System.IO.Error (isDoesNotExistError)
34−import System.Posix (getFileStatus, fileSize)
34+import System.PosixCompat.Files (getFileStatus, fileSize)
3535
3636-- | Serve static assets from an asset directory generated via @assets.nix@ or, failing that, from a regular directory.
3737--
lib/command/obelisk-command.cabal+1−1
@@ -45,7 +45,7 @@ library
4545 , text
4646 , time
4747 , transformers
48− , unix
48+ , unix-compat
4949 , unordered-containers
5050 , utf8-string
5151 , which
lib/command/src/Obelisk/Command.hs+3−2
@@ -22,7 +22,7 @@ import System.Environment
2222import System.FilePath
2323import qualified System.Info
2424import System.IO (hIsTerminalDevice, stdout)
25−import System.Posix.Process (executeFile)
25+import System.Process (rawSystem)
2626
2727import Obelisk.App
2828import Obelisk.CliApp
@@ -366,7 +366,8 @@ main' argsCfg = do
366366 Just impl -> do
367367 -- Invoke the real implementation, using --no-handoff to prevent infinite recursion
368368 putLog Debug $ "Handing off to " <> T.pack impl
369− liftIO $ executeFile impl False ("--no-handoff" : myArgs) Nothing
369+ _ <- liftIO $ rawSystem impl ("--no-handoff" : myArgs)
370+ return ()
370371 case myArgs of
371372 "--no-handoff" : as -> go as -- If we've been told not to hand off, don't hand off
372373 origPath:inPath:outPath:preprocessorName:packagePaths
lib/command/src/Obelisk/Command/Deploy.hs+1−1
@@ -25,7 +25,7 @@ import GHC.Generics
2525import System.Directory
2626import System.FilePath
2727import System.IO
28−import System.Posix.Files
28+import System.PosixCompat.Files
2929import Text.URI (URI)
3030import qualified Text.URI as URI
3131import Text.URI.Lens
lib/command/src/Obelisk/Command/Project.hs+3−2
@@ -39,8 +39,9 @@ import System.Environment (lookupEnv)
3939import System.FilePath
4040import System.IO.Temp
4141import System.IO.Unsafe (unsafePerformIO)
42−import System.Posix (FileStatus, FileMode, CMode (..), UserID, deviceID, fileID, fileMode, fileOwner, getFileStatus, getRealUserID)
43−import System.Posix.Files
42+import System.PosixCompat.Files
43+import System.PosixCompat.Types
44+import System.PosixCompat.User
4445import Text.ShellEscape (bash, bytes)
4546
4647import GitHub.Data.GitData (Branch)
lib/command/src/Obelisk/Command/Thunk.hs+1−1
@@ -56,7 +56,7 @@ import System.Exit
5656import System.FilePath
5757import System.IO.Error
5858import System.IO.Temp
59−import System.Posix (getSymbolicLinkStatus, modificationTime)
59+import System.PosixCompat.Files (getSymbolicLinkStatus, modificationTime)
6060import qualified Text.URI as URI
6161
6262import Obelisk.App (MonadObelisk)
lib/snap-extras/obelisk-snap-extras.cabal−1
@@ -12,7 +12,6 @@ library
1212 , base
1313 , bytestring
1414 , snap-core
15− , unix
1615 , directory
1716 , filepath
1817 , text