-- |Efficiently load an existing profile from disk and prepare it for network
-- transmission.
prepareLoadedProfile_ :: MonadBase IO m =>
                        FilePath -> m (PreparedProfile a)
prepareLoadedProfile_ path = liftBase $ do
  oldWd <- getCurrentDirectory
  setCurrentDirectory path
  prepareZipArchive <$>
    liftBase (addFilesToArchive [OptRecursive]
              emptyArchive ["."])
    <* setCurrentDirectory oldWd

-- |Prepare a zip file of a profile on disk for network transmission.
-- This function is very efficient at loading large profiles from disk.
prepareLoadedProfile_ :: MonadBase IO m =>
                        FilePath -> m (PreparedProfile a)
prepareLoadedProfile_ path = liftBase $ do
  oldWd <- getCurrentDirectory
  setCurrentDirectory path
  prepareZipArchive <$>
    liftBase (addFilesToArchive [OptRecursive]
              emptyArchive ["."])
    <* setCurrentDirectory oldWd

-- |Prepare a zip file of a profile on disk for network transmission.
-- This function is very efficient at loading large profiles from disk.
prepareLoadedProfile_ path = liftBase $ do
  oldWd <- getCurrentDirectory
  setCurrentDirectory path
  prepareZipArchive <$>
    liftBase (addFilesToArchive [OptRecursive]
              emptyArchive ["."])
    <* setCurrentDirectory oldWd

-- |Prepare a zip file of a profile on disk for network transmission.
-- This function is very efficient at loading large profiles from disk.