From ac83d47f718d531a8b07444ebb02c7850cc3c38b Mon Sep 17 00:00:00 2001 From: facundoolano Date: Thu, 14 Mar 2024 12:17:37 -0300 Subject: [PATCH] add --no-minify to jorge build --- commands/commands.go | 2 ++ markup/minify.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/commands.go b/commands/commands.go index d889113..8446c71 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -17,6 +17,7 @@ const DIR_RWE_MODE = 0777 type Build struct { ProjectDir string `arg:"" name:"path" optional:"" default:"." help:"Path to the website project to build."` + NoMinify bool `help:"Disable file minifying."` } // Read the files in src/ render them and copy the result to target/ @@ -27,6 +28,7 @@ func (cmd *Build) Run(ctx *kong.Context) error { if err != nil { return err } + config.Minify = !cmd.NoMinify err = site.Build(*config) fmt.Printf("done in %.2fs\n", time.Since(start).Seconds()) diff --git a/markup/minify.go b/markup/minify.go index e7cdf97..c531a42 100644 --- a/markup/minify.go +++ b/markup/minify.go @@ -26,7 +26,6 @@ func LoadMinifier() Minifier { return Minifier{minifier} } -// if enabled by config, minify web files func (m *Minifier) Minify(extension string, contentReader io.Reader) io.Reader { if !slices.Contains(SUPPORTED_MINIFIERS, extension) {