Skip to content

Commit

Permalink
Fix code page in a few more places #812
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 18, 2015
1 parent 3da2a5b commit c75915e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,15 @@ buildCmd moptionSynonym opts go
, opt
, "'"
]
fixCodePage' $ Stack.Build.build setLocalFiles (Just lk) opts
globalFixCodePage go $ Stack.Build.build setLocalFiles (Just lk) opts

fixCodePage'
| globalModifyCodePage go = fixCodePage
| otherwise = id
globalFixCodePage :: (Catch.MonadMask m, MonadIO m, MonadLogger m)
=> GlobalOpts
-> m a
-> m a
globalFixCodePage go
| globalModifyCodePage go = fixCodePage
| otherwise = id

uninstallCmd :: [String] -> GlobalOpts -> IO ()
uninstallCmd _ go = withConfigAndLock go $ do
Expand All @@ -715,7 +719,7 @@ updateCmd () go = withConfigAndLock go $
getMinimalEnvOverride >>= Stack.PackageIndex.updateAllIndices

upgradeCmd :: (Bool, String) -> GlobalOpts -> IO ()
upgradeCmd (fromGit, repo) go = withConfigAndLock go $
upgradeCmd (fromGit, repo) go = withConfigAndLock go $ globalFixCodePage go $
upgrade (if fromGit then Just repo else Nothing) (globalResolver go)

-- | Upload to Hackage
Expand Down Expand Up @@ -786,7 +790,7 @@ execCmd ExecOpts {..} go@GlobalOpts{..} =
ExecOptsEmbellished {..} ->
withBuildConfigAndLock go $ \lk -> do
let targets = concatMap words eoPackages
unless (null targets) $
unless (null targets) $ globalFixCodePage go $
Stack.Build.build (const $ return ()) (Just lk) defaultBuildOpts
{ boptsTargets = map T.pack targets
}
Expand All @@ -798,7 +802,7 @@ ghciCmd :: GhciOpts -> GlobalOpts -> IO ()
ghciCmd ghciOpts go@GlobalOpts{..} =
withBuildConfigAndLock go $ \lk -> do
let packageTargets = concatMap words (ghciAdditionalPackages ghciOpts)
unless (null packageTargets) $
unless (null packageTargets) $ globalFixCodePage go $
Stack.Build.build (const $ return ()) (Just lk) defaultBuildOpts
{ boptsTargets = map T.pack packageTargets
}
Expand Down

0 comments on commit c75915e

Please sign in to comment.