packages feed

elm-get 0.1.1.3 → 0.1.2

raw patch · 3 files changed

+29/−28 lines, 3 filesdep ~ElmPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: Elm

API changes (from Hackage documentation)

Files

elm-get.cabal view
@@ -1,5 +1,5 @@ Name:                elm-get-Version:             0.1.1.3+Version:             0.1.2 Synopsis:            Tool for sharing and using Elm libraries Description:         elm-get lets you install, update, and publish Elm libraries @@ -33,7 +33,7 @@                        bytestring,                        containers,                        directory,-                       Elm >= 0.12,+                       Elm >= 0.12.2,                        filepath,                        HTTP,                        http-client >= 0.3,@@ -69,7 +69,7 @@                        bytestring,                        containers,                        directory,-                       Elm >= 0.12,+                       Elm >= 0.12.2,                        filepath,                        HTTP,                        http-client >= 0.3,
src/Get/Dependencies.hs view
@@ -13,6 +13,7 @@     , license = "BSD3"     , repo = "https://github.com/USER/PROJECT.git"     , exposed = []+    , native = []     , elmVersion = V.elmVersion     , dependencies = []     }
src/Get/Install.hs view
@@ -56,36 +56,37 @@  installMay :: Maybe Library -> ErrorT String IO () installMay mlib =-  do (shouldCreate, deps) <- (withUnknown $ D.depsAt depsFile) `catchError` askCreate-     ups <--       execInstallM $ do when (shouldCreate == Create) $ tell (update id)-                         libs <- toInstall deps-                         forM_ libs $ install1 (shouldCreate /= NoCreate) deps-     liftIO $-       do writeUpdates deps ups-          putStrLn "Done!"-+  do (shouldCreate, deps) <- getDeps `catchError` askCreate+     ups <- execInstallM $ do+              when (shouldCreate == Create) $ tell (update id)+              libs <- toInstall deps+              forM_ libs $ install1 (shouldCreate /= NoCreate) deps+     liftIO $ do+       writeUpdates deps ups+       putStrLn "Success!"   where-    depsFile = EPath.dependencyFile-    withUnknown = fmap ((,) Unknown)+    getDeps =+      do deps <- D.depsAt EPath.dependencyFile+         return (Unknown, deps) -    toInstall deps = case mlib of-      Nothing ->-        do liftIO $ putStrLn "Installing all declared dependencies..."-           return $ map (\(n, v) -> Lib.Library n (Just v)) . D.dependencies $ deps-      Just l  -> return [l]+    toInstall deps =+      case mlib of+        Just lib -> return [lib]+        Nothing ->+            do liftIO $ putStrLn "Installing all declared dependencies..."+               return $ map (\(n, v) -> Lib.Library n (Just v)) . D.dependencies $ deps     -    askCreate _ =-      do yes <--           liftIO $ do putStr createMsg-                       Cmd.yesOrNo+    askCreate _errorMessage =+      do yes <- liftIO $ do+                  putStr createMsg+                  Cmd.yesOrNo          unless yes . liftIO . putStr $ didntUpdateMsg          let create = if yes then Create else NoCreate          return (create, defaultDeps)-     where-       createMsg =-           "Your project does not have a " ++ depsFile ++ " file, which the Elm\n" ++-           "compiler needs to detect dependencies. Should I create it? (y/n): "+      where+        createMsg =+            "Your project does not have a " ++ EPath.dependencyFile ++ " file, which the Elm\n" +++            "compiler needs to detect dependencies. Should I create it? (y/n): "  writeUpdates :: D.Deps -> Update -> IO () writeUpdates deps ups = case applyUpdates deps ups of@@ -117,7 +118,6 @@                     return version       when shouldAsk $ mkUpdate (Map.fromList . D.dependencies $ oldDeps) name finalVsn-     Cmd.out "Success!"    mkUpdate :: DepsMap -> N.Name -> V.Version -> InstallM () mkUpdate oldDeps n v = case Map.lookup n oldDeps of