File tree 1 file changed +6
-1
lines changed 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
module Stack.Options.ConfigParser where
2
2
3
3
import Data.Char
4
+ import Data.Either.Combinators
4
5
import Data.Monoid.Extra
5
6
import qualified Data.Set as Set
6
7
import Options.Applicative
7
8
import Options.Applicative.Builder.Extra
9
+ import Path
8
10
import Stack.Constants
9
11
import Stack.Options.BuildMonoidParser
10
12
import Stack.Options.DockerParser
@@ -46,7 +48,7 @@ configOptsParser hide0 =
46
48
" (Overrides any STACK_ROOT environment variable)" )
47
49
<> hide
48
50
))
49
- <*> optionalFirst (relDirOption
51
+ <*> optionalFirst (option (eitherReader (mapLeft showWorkDirError . parseRelDir))
50
52
( long " work-dir"
51
53
<> metavar " WORK-DIR"
52
54
<> help " Override work directory (default: .stack-work)"
@@ -129,3 +131,6 @@ configOptsParser hide0 =
129
131
toDumpLogs (First (Just True )) = First (Just DumpAllLogs )
130
132
toDumpLogs (First (Just False )) = First (Just DumpNoLogs )
131
133
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