-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Spago from a nested directory other than workspace root #1
base: file-paths
Are you sure you want to change the base?
Conversation
FS.mkdirp $ rootPath </> Paths.localCachePath | ||
FS.mkdirp $ rootPath </> Paths.localCachePackagesPath | ||
logDebug $ "Workspace root path: " <> Path.quote rootPath | ||
logDebug $ "Local cache: " <> Paths.localCachePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only semi-related to the change. I found that, before this change, Spago would always create a ./.spago
directory as soon as it's launched, even if it's only asked to registry search
. I moved this from mkRegistryEnv
to mkFetchEnv
, which seems to be logically always "in a workspace".
rightOrDieWith :: ∀ a b m err x. MonadEffect m => MonadAsk (LogEnv b) m => Loggable a => Either err x -> (err -> a) -> m x | ||
rightOrDieWith value toMsg = case value of | ||
rightOrDieWith :: ∀ a b m err x. MonadEffect m => MonadAsk (LogEnv b) m => Loggable a => (err -> a) -> Either err x -> m x | ||
rightOrDieWith toMsg value = case value of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function wasn't actually used anywhere (until now), so I swapped the parameters to allow it to be called with postfix application like foo >>= rightOrDieWith \err -> die $ "Error: " <> err
Right a -> | ||
pure a | ||
Left err -> | ||
die $ toMsg err | ||
|
||
rightOrDieWith' :: ∀ a b m err x. MonadEffect m => MonadAsk (LogEnv b) m => Loggable a => Either err x -> (err -> Array a) -> m x | ||
rightOrDieWith' value toMsg = case value of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also not used anywhere, and also is redundant, since there is an instance Loggable a => Loggable (Array a)
NOTE: this PR is built on top of purescript#1296, so for now it's targeted at my own fork. Once purescript#1296 is merged, I will open a proper PR to the original repo.
@f-f
Description of the change
Fixes purescript#1237
Allowing Spago to be launched from a directory nested within the workspace.
spago.yaml
containing a workspace.spago.yaml
files back down the tree and loads those that it hasn't loaded while walking up.spago.yml
(wrong extension) files.yml
files found along the way, if any, suggesting that they may have the wrong extension.Checklist:
[ ] Added some example of the new feature to theREADME