Skip to content

Instantly share code, notes, and snippets.

@aluink
Created January 6, 2012 20:06
Show Gist options
  • Save aluink/1572168 to your computer and use it in GitHub Desktop.
Save aluink/1572168 to your computer and use it in GitHub Desktop.
store :: FilePath -> B.ByteString -> String -> String -> IO ()
store tfp bn pn pv = do
de <- doesDirectoryExist pnd
when de $ removeDirectoryRecursive pnd
Tar.unpack packageDir . Tar.read . GZip.decompress =<< LBS.readFile tfp
renameFile tfp $ cpackageDir ++ (T.unpack $ decodeUtf8 bn)
where
pnd = packageDir ++ pn ++ [pathSeparator]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment