chore: migrate mail themes to shared framework and locked upstream inputs
This commit is contained in:
1 parent
5c0589f6f6
commit
fec3ace600
225 files changed
+4718
-15807
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitea-mail-templates/tools/builder"
|
||||
"gitea-mail-templates/tools/upstream"
|
||||
"github.com/urfave/cli/v2"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func BuildCommand() *cli.Command {
|
||||
return &cli.Command{Name: "build", Usage: "Generate installable themes from locked official inputs and shared controls", Flags: []cli.Flag{&cli.StringFlag{Name: "folder", Value: "../themes"}}, Action: func(c *cli.Context) error {
|
||||
s, err := upstream.Prepare(c.Context, filepath.Dir(c.String("folder")))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
filter, err := builder.Filter(c.Args().Slice())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
packages, err := builder.BuildAll(c.String("folder"), s, filter)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
output := filepath.Join(filepath.Dir(c.String("folder")), "build", "themes")
|
||||
if err := builder.Write(output, s, packages); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("[PASS] Built %d themes for %s at %s\n", len(packages), s.Lock.Tag, output)
|
||||
return nil
|
||||
}}
|
||||
}
|
||||
Reference in new issue
Block a user