chore: simplify workflows and unify tool logging and mail presentation
This commit is contained in:
1 parent
f4d96de79e
commit
c93f2bf8b2
40 files changed
+523
-1515
No files matched your search
+3
-2
@@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitea-mail-templates/tools/logging"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -44,7 +45,7 @@ func runDelete(c *cli.Context) error {
|
||||
}
|
||||
|
||||
if _, err := os.Stat(styleDir); os.IsNotExist(err) {
|
||||
fmt.Printf("\033[33m[W]\033[0m [CLI] '%s' does not exist, skipped\n", styleName)
|
||||
logging.Warn("CLI", "'%s' does not exist, skipped", styleName)
|
||||
continue
|
||||
}
|
||||
if _, err := builder.LoadTheme(styleDir); err != nil {
|
||||
@@ -54,7 +55,7 @@ func runDelete(c *cli.Context) error {
|
||||
if err := os.RemoveAll(styleDir); err != nil {
|
||||
return fmt.Errorf("cannot delete %s: %w", styleDir, err)
|
||||
}
|
||||
fmt.Printf("\033[32m[I]\033[0m [CLI] Deleted style '%s'\n", styleName)
|
||||
logging.Info("CLI", "Deleted style '%s'", styleName)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user