Skip to content

Commit

Permalink
When updating the database, show the download location
Browse files Browse the repository at this point in the history
  • Loading branch information
gutjuri committed Oct 8, 2020
1 parent 12ab04e commit 019a713
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Tldr/App/Handler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ updateTldrPages = do
let repoDir = dataDir </> "tldr"
repoExists <- doesDirectoryExist repoDir
if repoExists
then runProcess_ $
setWorkingDir repoDir $ proc "git" ["pull", "origin", "master"]
then do
putStrLn $ "Downloading tldr pages to " ++ repoDir
runProcess_ $
setWorkingDir repoDir $ proc "git" ["pull", "origin", "master"]
else initializeTldrPages

computeLocale :: Maybe String -> Locale
Expand Down Expand Up @@ -137,6 +139,7 @@ initializeTldrPages = do
unless initialized $ do
dataDir <- getXdgDirectory XdgData tldrDirName
createDirectoryIfMissing False dataDir
putStrLn $ "Initialising tldr page storage in " ++ dataDir
runProcess_ $ setWorkingDir dataDir $ proc "git" ["clone", repoHttpsUrl]

getCheckDirs :: ViewOptions -> [String]
Expand Down

0 comments on commit 019a713

Please sign in to comment.