Skip to content

Commit

Permalink
Do not show progress log for juvix html (#2920)
Browse files Browse the repository at this point in the history
We already print the html files that we write to disk, there is not need
to also show the progress log.
  • Loading branch information
janmasrovira authored Jul 30, 2024
1 parent 178bc53 commit 2524606
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions app/Commands/Html.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,40 @@ resultToJudocCtx res =
sres = res ^. resultInternal . resultScoper

runCommand :: forall r. (Members AppEffects r) => HtmlOptions -> Sem r ()
runCommand HtmlOptions {..}
| _htmlOnlySource = runGenOnlySourceHtml HtmlOptions {..}
| otherwise = do
entry <- getEntryPoint _htmlInputFile
(r, rs) <- runPipelineHtml _htmlNonRecursive _htmlInputFile
outputDir <- fromAppPathDir _htmlOutputDir
let ctx = resultToJudocCtx r <> mconcatMap resultToJudocCtx rs
Html.genJudocHtml
entry
JudocArgs
{ _judocArgsAssetsPrefix = _htmlAssetsPrefix,
_judocArgsBaseName = "proj",
_judocArgsCtx = ctx,
_judocArgsMainModule = r ^. resultInternal . resultScoper . Scoper.resultModule,
_judocArgsOutputDir = outputDir,
_judocArgsUrlPrefix = _htmlUrlPrefix,
_judocArgsIdPrefix = _htmlIdPrefix,
_judocArgsTheme = _htmlTheme,
_judocArgsNonRecursive = _htmlNonRecursive,
_judocArgsNoFooter = _htmlNoFooter,
_judocArgsNoPath = _htmlNoPath,
_judocArgsExt = _htmlExt,
_judocArgsStripPrefix = _htmlStripPrefix,
_judocArgsFolderStructure = _htmlFolderStructure
}
when _htmlOpen $ case openCmd of
Nothing -> logError "Could not recognize the 'open' command for your operating system"
Just opencmd ->
liftIO
. void
$ Process.spawnProcess
opencmd
[ toFilePath
( outputDir <//> Html.indexFileName
)
]
runCommand HtmlOptions {..} = silenceProgressLog $ do
if
| _htmlOnlySource -> runGenOnlySourceHtml HtmlOptions {..}
| otherwise -> do
entry <- getEntryPoint _htmlInputFile
(r, rs) <- runPipelineHtml _htmlNonRecursive _htmlInputFile
outputDir <- fromAppPathDir _htmlOutputDir
let ctx = resultToJudocCtx r <> mconcatMap resultToJudocCtx rs
Html.genJudocHtml
entry
JudocArgs
{ _judocArgsAssetsPrefix = _htmlAssetsPrefix,
_judocArgsBaseName = "proj",
_judocArgsCtx = ctx,
_judocArgsMainModule = r ^. resultInternal . resultScoper . Scoper.resultModule,
_judocArgsOutputDir = outputDir,
_judocArgsUrlPrefix = _htmlUrlPrefix,
_judocArgsIdPrefix = _htmlIdPrefix,
_judocArgsTheme = _htmlTheme,
_judocArgsNonRecursive = _htmlNonRecursive,
_judocArgsNoFooter = _htmlNoFooter,
_judocArgsNoPath = _htmlNoPath,
_judocArgsExt = _htmlExt,
_judocArgsStripPrefix = _htmlStripPrefix,
_judocArgsFolderStructure = _htmlFolderStructure
}
when _htmlOpen $ case openCmd of
Nothing -> logError "Could not recognize the 'open' command for your operating system"
Just opencmd ->
liftIO
. void
$ Process.spawnProcess
opencmd
[ toFilePath
( outputDir <//> Html.indexFileName
)
]

0 comments on commit 2524606

Please sign in to comment.