Skip to content

Commit

Permalink
Merge pull request #30 from gutjuri/show-download-location
Browse files Browse the repository at this point in the history
When updating the database, show the download location
  • Loading branch information
psibi authored Oct 8, 2020
2 parents 12ab04e + fab3058 commit 973b61a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.8.1

* When pages are updated, the client now shows the download location.

# 0.8.0

* Split the library into more parts.
Expand Down
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 973b61a

Please sign in to comment.