Skip to content

Commit

Permalink
Merge pull request #1775 from martin-kolinek/master
Browse files Browse the repository at this point in the history
Fix withUnpackedTarball7z to find name of srcDir after unpacking #1774
  • Loading branch information
mgsloan committed Feb 10, 2016
2 parents efcadef + 5390df6 commit 2ae2a0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,12 +1105,12 @@ withUnpackedTarball7z name si archiveFile archiveType msrcDir destDir = do
let tmpName = toFilePathNoTrailingSep (dirname destDir) ++ "-tmp"
ensureDir (parent destDir)
withTempDir (parent destDir) tmpName $ \tmpDir -> do
absSrcDir <- case msrcDir of
Just srcDir -> return $ tmpDir </> srcDir
Nothing -> expectSingleUnpackedDir archiveFile tmpDir
ignoringAbsence (removeDirRecur destDir)
run7z (parent archiveFile) archiveFile
run7z tmpDir tarFile
absSrcDir <- case msrcDir of
Just srcDir -> return $ tmpDir </> srcDir
Nothing -> expectSingleUnpackedDir archiveFile tmpDir
removeFile tarFile `catchIO` \e ->
$logWarn (T.concat
[ "Exception when removing "
Expand Down

0 comments on commit 2ae2a0d

Please sign in to comment.