Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
554f8b2e
Verified
Commit
554f8b2e
authored
Oct 09, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[utils] add missing Zip file
parent
4427590d
Pipeline
#5223
failed with stages
in 7 minutes and 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
Zip.hs
src/Gargantext/Utils/Zip.hs
+32
-0
No files found.
src/Gargantext/Utils/Zip.hs
0 → 100644
View file @
554f8b2e
{-|
Module : Gargantext.Utils.Zip
Description : Gargantext utilities
Copyright : (c) CNRS, 2017
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
Utilities for handling zip files
-}
{-# LANGUAGE PackageImports #-}
module
Gargantext.Utils.Zip
where
import
"zip"
Codec.Archive.Zip
(
withArchive
,
ZipArchive
)
-- import Control.Monad.Base (liftBase)
import
Data.ByteString
qualified
as
BS
import
Protolude
import
System.Directory
(
removeFile
)
import
System.IO.Temp
(
emptySystemTempFile
)
withZipFileBS
::
MonadIO
m
=>
BS
.
ByteString
->
ZipArchive
a
->
m
a
withZipFileBS
bs
actions
=
liftIO
$
bracket
(
emptySystemTempFile
"parsed-zip"
)
(
\
path
->
removeFile
path
)
$
\
path
->
do
BS
.
writeFile
path
bs
withArchive
path
actions
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment