on master help sign in
Bump shelly to 1.9.0 to unify FilePath types
commitf346cfe17da429a77efee6a2198d2f99df867b21 authorElliot Cameron <eacameron@gmail.com> dateSat 4 Jan 2020, 01:18 (7 years ago) parentd32aaee
3 files changed+9−6
default.nix+2 lib/selftest/obelisk-selftest.cabal+3−2 lib/selftest/src/Obelisk/SelfTest.hs+4−4
default.nix+2
@@ -47,6 +47,8 @@ let
4747 pkgs = self.callPackage ({ pkgs }: pkgs) {};
4848 onLinux = pkg: f: if pkgs.stdenv.isLinux then f pkg else pkg;
4949 in {
50+ shelly = self.callHackage "shelly" "1.9.0" {};
51+
5052 obelisk-executable-config-inject = pkgs.obeliskExecutableConfig.platforms.web.inject self;
5153
5254 obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (cleanSource ./lib/asset/manifest) {};
lib/selftest/obelisk-selftest.cabal+3−2
@@ -11,16 +11,17 @@ library
1111 base
1212 , containers
1313 , directory
14+ , filepath
1415 , hspec
1516 , http-client
1617 , http-types
1718 , HUnit
19+ , network
1820 , obelisk-cliapp
1921 , obelisk-executable-config-lookup
2022 , obelisk-run
2123 , process
22− , network
23− , shelly
24+ , shelly >= 1.9.0
2425 , temporary
2526 , text
2627 exposed-modules:
lib/selftest/src/Obelisk/SelfTest.hs+4−4
@@ -101,7 +101,7 @@ main = do
101101 hspec $ parallel $ do
102102 let shelly_ = void . shellyOb verbosity
103103
104− inTmp :: (Shelly.FilePath -> Sh a) -> IO ()
104+ inTmp :: (FilePath -> Sh a) -> IO ()
105105 inTmp f = withTmp (chdir <*> f)
106106
107107 withTmp f = shelly_ . withSystemTempDirectory "test λ" $ f . fromString
@@ -167,7 +167,7 @@ main = do
167167 if System.Info.os == "darwin"
168168 then it "can build ios" $ inTmpObInit $ \_ -> nixBuild ["-A", "ios.frontend"]
169169 else it "can build android after accepting license" $ inTmpObInit $ \dir -> do
170− let defaultNixPath = dir </> ("default.nix" :: Shelly.FilePath)
170+ let defaultNixPath = dir </> ("default.nix" :: FilePath)
171171 writefile defaultNixPath
172172 =<< T.replace
173173 "# config.android_sdk.accept_license = false;"
@@ -249,7 +249,7 @@ main = do
249249
250250
251251-- | Run `ob run` in the given directory (maximum of one level deep)
252−testObRunInDir :: Socket.PortNumber -> Socket.PortNumber -> Maybe Shelly.FilePath -> HTTP.Manager -> Sh ()
252+testObRunInDir :: Socket.PortNumber -> Socket.PortNumber -> Maybe FilePath -> HTTP.Manager -> Sh ()
253253testObRunInDir p0 p1 mdir httpManager = handle_sh (\case ExitSuccess -> pure (); e -> throw e) $ do
254254 let uri p = "http://localhost:" <> T.pack (show p) <> "/" -- trailing slash required for comparison
255255 writefile "config/common/route" $ uri p0
@@ -264,7 +264,7 @@ testObRunInDir p0 p1 mdir httpManager = handle_sh (\case ExitSuccess -> pure ();
264264 then errorExit $ "Reloading failed: expected " <> newUri <> " but got " <> runningUri
265265 else exit 0
266266
267−testThunkPack :: Shelly.FilePath -> Sh ()
267+testThunkPack :: FilePath -> Sh ()
268268testThunkPack path' = withTempFile (T.unpack $ toTextIgnore path') "test-file" $ \file handle -> do
269269 let pack' = readProcessWithExitCode "ob" ["thunk", "pack", T.unpack $ toTextIgnore path'] ""
270270 ensureThunkPackFails q = liftIO $ pack' >>= \case