Skip to content

Commit 8f4fc5a

Browse files
committed
Fix boolean condition
1 parent 41c2184 commit 8f4fc5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Spago/Command/Fetch.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,14 @@ run { packages: packagesRequestedToInstall, ensureRanges, isTest, isRepl } = do
179179
-- For solver-based projects, always ensure ranges (they're required for the solver to work)
180180
-- For package-set projects, only add ranges if explicitly requested
181181
-- Note: we can only add ranges if we have a target package (selected or root)
182+
-- If user explicitly passed --ensure-ranges, we should error if there's no target package
183+
-- If it's implicitly enabled (solver build), we silently skip when there's no target
182184
let
183185
isSolverBuild = case currentWorkspace.packageSet.buildType of
184186
RegistrySolverBuild _ -> true
185187
PackageSetBuild _ _ -> false
186188
hasTargetPackage = isJust currentWorkspace.selected || isJust currentWorkspace.rootPackage
187-
shouldEnsureRanges = (ensureRanges || isSolverBuild) && hasTargetPackage
189+
shouldEnsureRanges = ensureRanges || (isSolverBuild && hasTargetPackage)
188190

189191
when shouldEnsureRanges do
190192
{ configPath, package, yamlDoc } <- getPackageConfigPath "in which to add ranges."

0 commit comments

Comments
 (0)