use a red colored stderr writer for the cobra cmd errors
This commit is contained in:
@@ -105,12 +105,9 @@ func (p *plugin) updateCmd() *cobra.Command {
|
||||
var withBackup bool
|
||||
|
||||
command := &cobra.Command{
|
||||
Use: "update",
|
||||
Short: "Automatically updates the current PocketBase executable with the latest available version",
|
||||
// @todo remove after logs generalization
|
||||
// prevents printing the error log twice
|
||||
SilenceErrors: true,
|
||||
SilenceUsage: true,
|
||||
Use: "update",
|
||||
Short: "Automatically updates the current PocketBase executable with the latest available version",
|
||||
SilenceUsage: true,
|
||||
RunE: func(command *cobra.Command, args []string) error {
|
||||
var needConfirm bool
|
||||
if isMaybeRunningInDocker() {
|
||||
|
||||
@@ -118,13 +118,11 @@ func (p *plugin) createCommand() *cobra.Command {
|
||||
`
|
||||
|
||||
command := &cobra.Command{
|
||||
Use: "migrate",
|
||||
Short: "Executes app DB migration scripts",
|
||||
Long: cmdDesc,
|
||||
ValidArgs: []string{"up", "down", "create", "collections"},
|
||||
// prevents printing the error log twice
|
||||
SilenceErrors: true,
|
||||
SilenceUsage: true,
|
||||
Use: "migrate",
|
||||
Short: "Executes app DB migration scripts",
|
||||
Long: cmdDesc,
|
||||
ValidArgs: []string{"up", "down", "create", "collections"},
|
||||
SilenceUsage: true,
|
||||
RunE: func(command *cobra.Command, args []string) error {
|
||||
cmd := ""
|
||||
if len(args) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user