From caf12b6a101b26585e0e55489e4a7a4a1d9cf99b Mon Sep 17 00:00:00 2001 From: klntsky Date: Mon, 29 Jul 2019 14:14:23 +0300 Subject: [PATCH 1/2] Applied suggestions from #333 --- app/Spago.hs | 2 +- src/Spago/Build.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Spago.hs b/app/Spago.hs index 21501292d..e85d6e81d 100644 --- a/app/Spago.hs +++ b/app/Spago.hs @@ -235,7 +235,7 @@ parser = do search = ( "search" - , "Run the search engine." + , "Start a search REPL to find definitions matching names and types" , pure Search ) diff --git a/src/Spago/Build.hs b/src/Spago/Build.hs index c3daffdb7..75c0b0588 100644 --- a/src/Spago/Build.hs +++ b/src/Spago/Build.hs @@ -218,7 +218,7 @@ docs format sourcePaths depsOnly = do echoDebug $ "Running `" <> cmd <> "`" shell cmd empty >>= \case ExitSuccess -> pure () - ExitFailure n -> die $ "Failed while trying to make the documentation searchable: " <> repr n + ExitFailure n -> echo $ "Failed while trying to make the documentation searchable: " <> repr n where isHTMLFormat = \case From ee7f10168fdfdacd5dcd48e80d31853dcc0bdf87 Mon Sep 17 00:00:00 2001 From: klntsky Date: Mon, 29 Jul 2019 14:39:21 +0300 Subject: [PATCH 2/2] factor out docsSearchVersion --- src/Spago/Prelude.hs | 6 ++++++ src/Spago/Templates.hs | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Spago/Prelude.hs b/src/Spago/Prelude.hs index fc273b945..7770a2b91 100644 --- a/src/Spago/Prelude.hs +++ b/src/Spago/Prelude.hs @@ -71,6 +71,7 @@ module Spago.Prelude , withTaskGroup' , Turtle.mktempdir , getModificationTime + , docsSearchVersion ) where @@ -241,3 +242,8 @@ assertDirectory directory = do Directory.createDirectory directory Directory.setPermissions directory private + + +-- | Release tag for the `purescript-docs-search` app. +docsSearchVersion :: Text +docsSearchVersion = "v0.0.4" diff --git a/src/Spago/Templates.hs b/src/Spago/Templates.hs index 81ce8d22d..547496bc7 100644 --- a/src/Spago/Templates.hs +++ b/src/Spago/Templates.hs @@ -6,6 +6,7 @@ import Data.FileEmbed (embedFile) import qualified Data.Text as T import Spago.TH (embedFileUtf8, embedURLWithFallback) +import Spago.Prelude packagesDhall :: T.Text @@ -29,11 +30,17 @@ bowerJson = $(embedFile "templates/bower.json") docsSearchApp :: T.Text docsSearchApp = $(embedURLWithFallback - "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.4/docs-search-app.js" + ( "https://github.com/spacchetti/purescript-docs-search/releases/download/" + <> T.unpack docsSearchVersion + <> "/docs-search-app.js" + ) "templates/docs-search-app.js") docsSearch :: T.Text docsSearch = $(embedURLWithFallback - "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.4/purescript-docs-search" + ( "https://github.com/spacchetti/purescript-docs-search/releases/download/" + <> T.unpack docsSearchVersion + <> "/purescript-docs-search" + ) "templates/purescript-docs-search")