on master help sign in
Merge pull request #740 from mightybyte/windows-compat
db6b886Elliot Cameron
lib/asset/manifest/obelisk-asset-manifest.cabal+1−1
@@ -24,7 +24,7 @@ library
24 , template-haskell
24 , template-haskell
25 , text
25 , text
26 , transformers
26 , transformers
27− , unix
27+ , unix-compat
28 , vector
28 , vector
29 exposed-modules:
29 exposed-modules:
30 Obelisk.Asset.Gather
30 Obelisk.Asset.Gather
lib/asset/manifest/src/Obelisk/Asset/Symlink.hs+1−1
@@ -7,7 +7,7 @@ import Data.Map (Map)
7import qualified Data.Map as Map
7import qualified Data.Map as Map
8import System.Directory
8import System.Directory
9import System.FilePath.Posix
9import System.FilePath.Posix
10−import System.Posix.Files
10+import System.PosixCompat.Files
11
11
12-- | Copy the given hashed files from one location to hashed paths in another
12-- | Copy the given hashed files from one location to hashed paths in another
13-- location, and symlink the unhashed paths to the hashed ones
13-- 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
23 , obelisk-snap-extras
23 , obelisk-snap-extras
24 , text
24 , text
25 , transformers
25 , transformers
26− , unix
26+ , unix-compat
27 exposed-modules:
27 exposed-modules:
28 Obelisk.Asset.Accept
28 Obelisk.Asset.Accept
29 Obelisk.Asset.Serve.Snap
29 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)
31import System.Directory (getDirectoryContents)
31import System.Directory (getDirectoryContents)
32import System.FilePath ((</>), splitFileName, takeDirectory)
32import System.FilePath ((</>), splitFileName, takeDirectory)
33import System.IO.Error (isDoesNotExistError)
33import System.IO.Error (isDoesNotExistError)
34−import System.Posix (getFileStatus, fileSize)
34+import System.PosixCompat.Files (getFileStatus, fileSize)
35
35
36-- | Serve static assets from an asset directory generated via @assets.nix@ or, failing that, from a regular directory.
36-- | Serve static assets from an asset directory generated via @assets.nix@ or, failing that, from a regular directory.
37--
37--
lib/command/obelisk-command.cabal+1−1
@@ -45,7 +45,7 @@ library
45 , text
45 , text
46 , time
46 , time
47 , transformers
47 , transformers
48− , unix
48+ , unix-compat
49 , unordered-containers
49 , unordered-containers
50 , utf8-string
50 , utf8-string
51 , which
51 , which
lib/command/src/Obelisk/Command.hs+3−2
@@ -22,7 +22,7 @@ import System.Environment
22import System.FilePath
22import System.FilePath
23import qualified System.Info
23import qualified System.Info
24import System.IO (hIsTerminalDevice, stdout)
24import System.IO (hIsTerminalDevice, stdout)
25−import System.Posix.Process (executeFile)
25+import System.Process (rawSystem)
26
26
27import Obelisk.App
27import Obelisk.App
28import Obelisk.CliApp
28import Obelisk.CliApp
@@ -366,7 +366,8 @@ main' argsCfg = do
366 Just impl -> do
366 Just impl -> do
367 -- Invoke the real implementation, using --no-handoff to prevent infinite recursion
367 -- Invoke the real implementation, using --no-handoff to prevent infinite recursion
368 putLog Debug $ "Handing off to " <> T.pack impl
368 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 ()
370 case myArgs of
371 case myArgs of
371 "--no-handoff" : as -> go as -- If we've been told not to hand off, don't hand off
372 "--no-handoff" : as -> go as -- If we've been told not to hand off, don't hand off
372 origPath:inPath:outPath:preprocessorName:packagePaths
373 origPath:inPath:outPath:preprocessorName:packagePaths
lib/command/src/Obelisk/Command/Deploy.hs+1−1
@@ -25,7 +25,7 @@ import GHC.Generics
25import System.Directory
25import System.Directory
26import System.FilePath
26import System.FilePath
27import System.IO
27import System.IO
28−import System.Posix.Files
28+import System.PosixCompat.Files
29import Text.URI (URI)
29import Text.URI (URI)
30import qualified Text.URI as URI
30import qualified Text.URI as URI
31import Text.URI.Lens
31import Text.URI.Lens
lib/command/src/Obelisk/Command/Project.hs+3−2
@@ -39,8 +39,9 @@ import System.Environment (lookupEnv)
39import System.FilePath
39import System.FilePath
40import System.IO.Temp
40import System.IO.Temp
41import System.IO.Unsafe (unsafePerformIO)
41import System.IO.Unsafe (unsafePerformIO)
42−import System.Posix (FileStatus, FileMode, CMode (..), UserID, deviceID, fileID, fileMode, fileOwner, getFileStatus, getRealUserID)
42+import System.PosixCompat.Files
43−import System.Posix.Files
43+import System.PosixCompat.Types
44+import System.PosixCompat.User
44import Text.ShellEscape (bash, bytes)
45import Text.ShellEscape (bash, bytes)
45
46
46import GitHub.Data.GitData (Branch)
47import GitHub.Data.GitData (Branch)
lib/command/src/Obelisk/Command/Thunk.hs+1−1
@@ -56,7 +56,7 @@ import System.Exit
56import System.FilePath
56import System.FilePath
57import System.IO.Error
57import System.IO.Error
58import System.IO.Temp
58import System.IO.Temp
59−import System.Posix (getSymbolicLinkStatus, modificationTime)
59+import System.PosixCompat.Files (getSymbolicLinkStatus, modificationTime)
60import qualified Text.URI as URI
60import qualified Text.URI as URI
61
61
62import Obelisk.App (MonadObelisk)
62import Obelisk.App (MonadObelisk)
lib/snap-extras/obelisk-snap-extras.cabal−1
@@ -12,7 +12,6 @@ library
12 , base
12 , base
13 , bytestring
13 , bytestring
14 , snap-core
14 , snap-core
15− , unix
16 , directory
15 , directory
17 , filepath
16 , filepath
18 , text
17 , text