@@ -220,7 +220,8 @@ getConstraints name version =
221getConstraintsHelp :: Stuff.PackageCache -> Connection -> Pkg.Name -> V.Version -> IO (Either Problem Constraints)
221getConstraintsHelp :: Stuff.PackageCache -> Connection -> Pkg.Name -> V.Version -> IO (Either Problem Constraints)
222getConstraintsHelp cache connection name version =
222getConstraintsHelp cache connection name version =
223− do let path = Stuff.package cache name version </> "elm.json"
223+ do let home = Stuff.package cache name version
224+ let path = home </> "elm.json"
224 outlineExists <- File.exists path
225 outlineExists <- File.exists path
225 if outlineExists
226 if outlineExists
@@ -246,10 +247,11 @@ getConstraintsHelp cache connection name version =
246 return (Left (UnavailableOffline name version))
247 return (Left (UnavailableOffline name version))
248 Online manager ->
249 Online manager ->
249− Http.post manager (Website.metadata name version "elm.json") [] BadHttp $ \body ->
250+ Http.get manager (Website.metadata name version "elm.json") [] BadHttp $ \body ->
250 case D.fromByteString constraintsDecoder body of
251 case D.fromByteString constraintsDecoder body of
251 Right cs ->
252 Right cs ->
253+ do Dir.createDirectoryIfMissing True home
252− do File.writeUtf8 path body
254+ File.writeUtf8 path body
253 return $ Right cs
255 return $ Right cs
255 Left _ ->
257 Left _ ->