chore: fix ctrl-c aborts server
This commit is contained in:
parent
0fd07134be
commit
f514986143
1 changed files with 4 additions and 2 deletions
|
|
@ -56,9 +56,11 @@ var (
|
|||
runAsService bool
|
||||
)
|
||||
|
||||
const rootName = "evcc"
|
||||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "evcc",
|
||||
Use: rootName,
|
||||
Short: "evcc - open source solar charging",
|
||||
Version: util.FormattedVersion(),
|
||||
Run: runRoot,
|
||||
|
|
@ -135,7 +137,7 @@ func Execute() {
|
|||
}
|
||||
|
||||
func allowCtrlC(cmd *cobra.Command, args []string) {
|
||||
if cmd.Name() == "root" {
|
||||
if cmd.Name() == rootName {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue