shake-0.14.1: Build system library, like Make, but more accurate dependencies.

Safe HaskellSafe-Inferred

Development.Shake.FilePath

Description

A module for FilePath operations exposing System.FilePath plus some additional operations.

Synopsis

Documentation

dropDirectory1 :: FilePath -> FilePathSource

Drop the first directory from a FilePath. Should only be used on relative paths.

 dropDirectory1 "aaa/bbb" == "bbb"
 dropDirectory1 "aaa/" == ""
 dropDirectory1 "aaa" == ""
 dropDirectory1 "" == ""

takeDirectory1 :: FilePath -> FilePathSource

Take the first component of a FilePath. Should only be used on relative paths.

 takeDirectory1 "aaa/bbb" == "aaa"
 takeDirectory1 "aaa/" == "aaa"
 takeDirectory1 "aaa" == "aaa"

normaliseEx :: FilePath -> FilePathSource

Normalise a FilePath, trying to do:

  • All pathSeparators become /
  • foo/bar/../baz becomes foo/baz
  • foo/./bar becomes foo/bar
  • foo//bar becomes foo/bar

This function is not based on the normalise function from the filepath library, as that function is quite broken.

(-<.>) :: FilePath -> String -> FilePathSource

Remove the current extension and add another, an alias for replaceExtension.

toNative :: FilePath -> FilePathSource

Convert to native path separators, namely \ on Windows.

toStandard :: FilePath -> FilePathSource

Convert all path separators to /, even on Windows.

exe :: StringSource

The extension of executables, "exe" on Windows and "" otherwise.