Skip to content

Instantly share code, notes, and snippets.

@cbarrett
Created April 4, 2013 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbarrett/5306724 to your computer and use it in GitHub Desktop.
Save cbarrett/5306724 to your computer and use it in GitHub Desktop.
addDependentTree :: FilePath -> Bool -> Q ()
addDependentTree p inclFile = do
pwd <- runIO getCurrentDirectory
let p' = if not inclFile then dropFileName p else p
let paths = scanl (</>) pwd (splitDirectories p')
mapM_ addDependentFile paths -- We add every subdirectory along `p` in the hopes of catching any new files added therein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment