Skip to content

Commit

Permalink
Add windows to checkDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kove W. Ochre-Salter committed Nov 18, 2018
1 parent 82367b5 commit 97b0a8a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repoHttpsUrl :: String
repoHttpsUrl = "https://github.com/tldr-pages/tldr.git"

checkDirs :: [String]
checkDirs = ["common", "linux", "osx"]
checkDirs = ["common", "linux", "osx", "windows"]

tldrInitialized :: IO Bool
tldrInitialized = do
Expand Down Expand Up @@ -84,14 +84,15 @@ getPagePath :: String -> IO (Maybe FilePath)
getPagePath page = do
homeDir <- getHomeDirectory
let pageDir = homeDir </> tldrDirName </> "tldr" </> "pages"
x@(f1:f2:f3:[]) = map (\x -> pageDir </> x </> page <.> "md") checkDirs
x@(f1:f2:f3:f4:[]) = map (\x -> pageDir </> x </> page <.> "md") checkDirs
#if MIN_VERSION_base(4,7,0)
f1' <- pageExists f1
f2' <- pageExists f2
f3' <- pageExists f3
return $ f1' <|> f2' <|> f3'
f4' <- pageExists f4
return $ f1' <|> f2' <|> f3' <|> f4'
#else
pageExists f1 <|> pageExists f2 <|> pageExists f3
pageExists f1 <|> pageExists f2 <|> pageExists f3 <|> pageExists f4
#endif


Expand Down

0 comments on commit 97b0a8a

Please sign in to comment.