@hackage ignore0.1.0.0

Handle ignore files of different VCSes

ignore

Build Status

Intro

Hackage: ignore

Library and tiny tool for working with ignore files of different version control systems.

Library Usage

module Main where

import Ignore

import Path
import System.Environment
import System.Directory

main :: IO ()
main =
    do dir <- getCurrentDirectory >>= parseAbsDir
       ignoreFiles <- findIgnoreFiles [VCSGit, VCSMercurial, VCSDarcs] dir
       checker <- buildChecker ignoreFiles
       case checker of
           Left err -> error err
           Right (FileIgnoredChecker isFileIgnored) ->
           	  putStrLn $ 
           	    "Main.hs is " 
           	    ++ (if isFileIgnored "Main.hs" 
           	        then "ignored" else "not ignored")

Commandline Usage

Run in any project under version control to check if a file is ignored or not.

$ ignore foo~ dist/bar distinct
File foo~ IGNORED
File dist/foo IGNORED
File distinct not ignored

Install

  • Using cabal: cabal install ignore
  • From Source: git clone https://github.com/agrafix/ignore.git && cd ignore && cabal install
  • Using stack: git clone https://github.com/agrafix/ignore.git && cd ignore && stack build