Skip to content

Commit a0a2994

Browse files
committed
find root spago.yaml filepath, not file
1 parent 3d1c212 commit a0a2994

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Spago/Config.purs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ type PrelimWorkspace =
179179
-- | Reads all the configurations in the tree and builds up the Map of local
180180
-- | packages to be integrated in the package set
181181
readWorkspace :: a. ReadWorkspaceOptions -> Spago (Registry.RegistryEnv a) Workspace
182+
-- readWorkspace readWorkspaceOptions@{ maybeSelectedPackage, pureBuild, migrateConfig } = do
182183
readWorkspace { maybeSelectedPackage, pureBuild, migrateConfig } = do
183184
logInfo "Reading spago.yaml..."
184185

@@ -234,12 +235,16 @@ readWorkspace { maybeSelectedPackage, pureBuild, migrateConfig } = do
234235
-- do not search up the file tree further than this
235236
logInfo $ "No Spago workspace found in any directory up to project root: " <> path <> gitRoot
236237
pure Nothing
237-
Just ws -> pure (pure (Tuple spagoYaml ws))
238+
Just ws -> do
239+
logInfo spagoYaml
240+
pure (map (\p -> (Tuple p ws)) (String.stripSuffix (Pattern "spago.yaml") spagoYaml))
238241
Tuple (Just spagoYaml) Nothing -> do
239242
mWorkspace :: Maybe PrelimWorkspace <- checkForWorkspace spagoYaml
240243
case mWorkspace of
241244
Nothing -> searchHigherPaths otherPaths
242-
Just ws -> pure (pure (Tuple spagoYaml ws))
245+
Just ws -> do
246+
logInfo spagoYaml
247+
pure (map (\p -> (Tuple p ws)) (String.stripSuffix (Pattern "spago.yaml") spagoYaml))
243248

244249
-- First try to read the config in the root.
245250
-- Else, look for a workspace in parent directories.

0 commit comments

Comments
 (0)