-
Notifications
You must be signed in to change notification settings - Fork 843
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
global -p option #542
global -p option #542
Conversation
I'm -1 on the |
localDir <- liftIO (getAppUserDataDirectory "local") >>= parseAbsDir | ||
return $ localDir </> $(mkRelDir "bin") | ||
Just userPath -> do | ||
tryPath <- try (liftIO $ canonicalizePath userPath >>= parseAbsDir) |
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 won't work if the directory doesn't already exist. Possible solution: call createDirectoryIfMissing True userPath
first. Not sure if it's worth it.
Summary of commit be8dbb1: Dropped I am opposed to employing
Basically fail fast and hard on a typo, not silently doing what the user doesn't want. The other change was to match only on IOException, which is the only thing that I think canonicalizePath can throw. Looking at the code for Path, it can throw a PathParseException which I will go ahead and cover. |
Summary of 55a5476: |
@snoyberg: I talked with @manny-fp about the naming and he also liked |
@manny-fp Please merge when you're ready, I'm fine with this PR. |
Just userPath -> | ||
(liftIO $ canonicalizePath userPath >>= parseAbsDir) | ||
`catches` | ||
[Handler (\(ex :: IOException) -> error |
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.
Should not be using error
, instead throw a new ConfigException constructor.
stack.yaml file also also uses "local-bin-path" field to specify path
--local-bin-path option for install
@snoyberg Any suggestions for naming these options:
--local-bin-path
seems to make sense, but I'm not a fan of-p
. Also note that the invocation will be a lot more natural once #519 is implemented.