shellmate-extras- Extra functionality for shellmate.

Safe HaskellNone




Extract various archive files in a consistent manner.


Extracting archives

extract :: FilePath -> Shell () Source #

Extract an archive with the default options. See ExtractOptions for details.

extractWith :: ExtractOptions -> FilePath -> Shell () Source #

Extract an archive with the given extraction options.

supportedExtensions :: [String] Source #

The list of supported archive format file extensions. On a typical LinuxOSXCygwin/MinGW system, .tar, .tar.gz, .tar.bz2, .tar.xz, .tbz2, .tgz, .bz2, .gz and .xz should all be supported. If the appropriate programs are installed, .zip, .rar and .7z should also be supported.

canExtract :: FilePath -> Bool Source #

Can the given file be extracted, as determined by comparing the file extension to the list of supported extensions.

Extraction options

separateDirectory :: ExtractOptions -> Bool Source #

Extract archive into a separate directory. The name of the directory will be the base name of the archive. If the archive contains a single directory on the top-level, the contents of that directory will be moved into the outer directory. This ensures that tarbombs and non-tarbombs are treated consistently.

If this option is set to False, archives will be unpacked into the current working directory.

Default: True

removeArchive :: ExtractOptions -> Bool Source #

Remove the archive after extraction?

Default: False

defaultExtractOptions :: ExtractOptions Source #

Default extraction options. See ExtractOptions for defaults.