Skip to content

Commit

Permalink
Submit my will to the autoformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoikin committed Aug 21, 2024
1 parent 0cc89f6 commit 91e05be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/Spago/Command/Build.purs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ run opts = do
globs = getBuildGlobs
{ dependencies: case workspace.selected of
Just p ->
let { core, test } = unsafeFromJust $ Map.lookup p.package.name dependencies
in Map.union core test
let
{ core, test } = unsafeFromJust $ Map.lookup p.package.name dependencies
in
Map.union core test
Nothing ->
allDependencies
, depsOnly: opts.depsOnly
Expand Down
26 changes: 14 additions & 12 deletions src/Spago/Command/Fetch.purs
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ writeNewLockfile reason allTransitiveDeps = do
toAllDependencies :: PackageTransitiveDeps -> PackageMap
toAllDependencies =
Map.values
>>> foldMap (\m -> [m.core, m.test])
>>> foldl Map.union Map.empty
>>> foldMap (\m -> [ m.core, m.test ])
>>> foldl Map.union Map.empty

getGitPackageInLocalCache :: forall a. PackageName -> GitPackage -> Spago (Git.GitEnv a) Unit
getGitPackageInLocalCache name package = do
Expand Down Expand Up @@ -502,15 +502,18 @@ getTransitiveDeps workspacePackage = do
-- No lockfile, we need to build a plan from scratch, and hit the Registry and so on
Left _ -> case workspace.packageSet.buildType of
RegistrySolverBuild extraPackages -> do
let forEnv envName depsRanges' = do
plan <- getTransitiveDepsFromRegistry depsRanges' extraPackages
logDebug $ Array.fold
[ "Got a plan from the Solver for ", envName, " deps: "
, printJson (Internal.Codec.packageMap Version.codec) plan
]
pure $ plan # Map.mapMaybeWithKey \packageName version -> case Map.lookup packageName extraPackages of
Just p -> Just p
Nothing -> Just $ RegistryVersion version
let
forEnv envName depsRanges' = do
plan <- getTransitiveDepsFromRegistry depsRanges' extraPackages
logDebug $ Array.fold
[ "Got a plan from the Solver for "
, envName
, " deps: "
, printJson (Internal.Codec.packageMap Version.codec) plan
]
pure $ plan # Map.mapMaybeWithKey \packageName version -> case Map.lookup packageName extraPackages of
Just p -> Just p
Nothing -> Just $ RegistryVersion version

{ core: _, test: _ }
<$> forEnv "core" depsRanges.core
Expand Down Expand Up @@ -558,7 +561,6 @@ getTransitiveDepsFromRegistry depsRanges extraPackages = do
let deps = fromMaybe Map.empty $ map (_.dependencies <<< unwrap) maybeManifest
pure (Tuple v deps)


maybePlan <- Registry.Solver.loadAndSolve loader depsRanges

case maybePlan of
Expand Down

0 comments on commit 91e05be

Please sign in to comment.