Skip to content

Commit 7d961eb

Browse files
committed
Make packageToSdist restore $OLDPWD
1 parent 1fc266e commit 7d961eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cabal-install/Distribution/Client/CmdSdist.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
219219
dir <- case packageSource pkg of
220220
LocalUnpackedPackage path -> return path
221221
_ -> die' verbosity "The impossible happened: a local package isn't local"
222+
oldPwd <- getCurrentDirectory
222223
setCurrentDirectory dir
223224

224225
let norm flag = fmap ((flag, ) . normalise)
@@ -286,6 +287,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
286287
write (Zip.fromArchive archive)
287288
when (outputFile /= "-") $
288289
notice verbosity $ "Wrote zip sdist to " ++ outputFile ++ "\n"
290+
setCurrentDirectory oldPwd
289291

290292
--
291293

0 commit comments

Comments
 (0)