Skip to content

Expose TarPath -> PosixString #98

@Bodigrim

Description

@Bodigrim

Essentially this, but with a better name:

fromTarPathInternal :: PosixChar -> TarPath -> PosixString
fromTarPathInternal sep = go
where
posixSep = PS.unsafeFromChar FilePath.Posix.pathSeparator
adjustSeps = if sep == posixSep then id else
PS.map $ \c -> if c == posixSep then sep else c
go (TarPath name prefix)
| PS.null prefix = adjustSeps name
| PS.null name = adjustSeps prefix
| otherwise = adjustSeps prefix <> PS.cons sep (adjustSeps name)

Or maybe just expose data TarPath from somewhere?..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions