File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11module Stack.Options.ConfigParser where
22
33import Data.Char
4+ import Data.Either.Combinators
45import Data.Monoid.Extra
56import qualified Data.Set as Set
67import Options.Applicative
78import Options.Applicative.Builder.Extra
9+ import Path
810import Stack.Constants
911import Stack.Options.BuildMonoidParser
1012import Stack.Options.DockerParser
@@ -46,7 +48,7 @@ configOptsParser hide0 =
4648 " (Overrides any STACK_ROOT environment variable)" )
4749 <> hide
4850 ))
49- <*> optionalFirst (relDirOption
51+ <*> optionalFirst (option (eitherReader (mapLeft showWorkDirError . parseRelDir))
5052 ( long " work-dir"
5153 <> metavar " WORK-DIR"
5254 <> help " Override work directory (default: .stack-work)"
@@ -129,3 +131,6 @@ configOptsParser hide0 =
129131 toDumpLogs (First (Just True )) = First (Just DumpAllLogs )
130132 toDumpLogs (First (Just False )) = First (Just DumpNoLogs )
131133 toDumpLogs (First Nothing ) = First Nothing
134+ showWorkDirError err = show err ++
135+ " \n Note that --work-dir must be a relative child directory, because work-dirs outside of the package are not supported by Cabal." ++
136+ " \n See https://github.com/commercialhaskell/stack/issues/2954"
You can’t perform that action at this time.
0 commit comments