Adds imports and fixes typos
This commit is contained in:
parent
73e8188564
commit
c98d8a8608
1 changed files with 12 additions and 6 deletions
|
@ -1,6 +1,11 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"git.ctrlz.es/mgdelacroix/campaigner/jira"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -51,13 +56,13 @@ func getVarMap(vars []string) (map[string]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func createJiraTicketStandaloneCmdF(cmd *cobra.Command, _ []string) error {
|
func createJiraTicketStandaloneCmdF(cmd *cobra.Command, _ []string) error {
|
||||||
username, _ = cmd.Flags().GetString("username")
|
username, _ := cmd.Flags().GetString("username")
|
||||||
token, _ = cmd.Flags().GetString("token")
|
token, _ := cmd.Flags().GetString("token")
|
||||||
summary, _ = cmd.Flags().GetString("summary")
|
summary, _ := cmd.Flags().GetString("summary")
|
||||||
template, _ = cmd.Flags().GetString("template")
|
template, _ := cmd.Flags().GetString("template")
|
||||||
vars, _ = cmd.Flags().GetStringSlice("vars")
|
vars, _ := cmd.Flags().GetStringSlice("vars")
|
||||||
|
|
||||||
varMap, err = getVarMap(vars)
|
varMap, err := getVarMap(vars)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error processing vars: %w")
|
return fmt.Errorf("error processing vars: %w")
|
||||||
}
|
}
|
||||||
|
@ -76,4 +81,5 @@ func createJiraTicketStandaloneCmdF(cmd *cobra.Command, _ []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Printf("Ticket %s successfully created in JIRA")
|
cmd.Printf("Ticket %s successfully created in JIRA")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue