omit empty fields when saving yaml
This commit is contained in:
@ -15,21 +15,21 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ClientConfig struct {
|
type ClientConfig struct {
|
||||||
ClientName *string `yaml:"clientName"`
|
ClientName *string `yaml:"clientName,omitempty"`
|
||||||
ClientDisplayName *string `yaml:"clientDisplayName"`
|
ClientDisplayName *string `yaml:"clientDisplayName,omitempty"`
|
||||||
Command *string `yaml:"command"`
|
Command *string `yaml:"command,omitempty,omitempty"`
|
||||||
CommandArgs *string `yaml:"commandArgs"`
|
CommandArgs *string `yaml:"commandArgs,omitempty"`
|
||||||
StopCommand *string `yaml:"stopCommand"`
|
StopCommand *string `yaml:"stopCommand,omitempty"`
|
||||||
Delay *string `yaml:"delay"`
|
Delay *string `yaml:"delay,omitempty"`
|
||||||
Start *bool `yaml:"start"`
|
Start *bool `yaml:"start,omitempty"`
|
||||||
NoShellService *bool `yaml:"noShellService"`
|
NoShellService *bool `yaml:"noShellService,omitempty"`
|
||||||
CommandInPath *bool `yaml:"commandInPath"`
|
CommandInPath *bool `yaml:"commandInPath,omitempty"`
|
||||||
Executable *string `yaml:"executable"`
|
Executable *string `yaml:"executable,omitempty"`
|
||||||
ExtendClassPath string `yaml:"-"`
|
ExtendClassPath string `yaml:"-,omitempty"`
|
||||||
JavaShellService *string `yaml:"javaShellService"`
|
JavaShellService *string `yaml:"javaShellService,omitempty"`
|
||||||
NoAutoSuffixWindows *bool `yaml:"noAutoSuffixWindows"`
|
NoAutoSuffixWindows *bool `yaml:"noAutoSuffixWindows,omitempty"`
|
||||||
TargetOS *string `yaml:"targetOS"`
|
TargetOS *string `yaml:"targetOS,omitempty"`
|
||||||
ResourceDir *string `yaml:"resourceDir"`
|
ResourceDir *string `yaml:"resourceDir,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func karenConfig() string {
|
func karenConfig() string {
|
||||||
|
@ -18,36 +18,36 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type PluginConfig struct {
|
type PluginConfig struct {
|
||||||
PluginName *string `yaml:"name"`
|
PluginName *string `yaml:"name,omitempty"`
|
||||||
KeyName *string `yaml:"key"`
|
KeyName *string `yaml:"key,omitempty"`
|
||||||
Signer *string `yaml:"signer"`
|
Signer *string `yaml:"signer,omitempty"`
|
||||||
Version *string `yaml:"version"`
|
Version *string `yaml:"version,omitempty"`
|
||||||
License *string `yaml:"license"`
|
License *string `yaml:"license,omitempty"`
|
||||||
Date *string `yaml:"date"`
|
Date *string `yaml:"date,omitempty"`
|
||||||
Author *string `yaml:"author"`
|
Author *string `yaml:"author,omitempty"`
|
||||||
Website *string `yaml:"website"`
|
Website *string `yaml:"website,omitempty"`
|
||||||
UpdateURL *string `yaml:"updateURL"`
|
UpdateURL *string `yaml:"updateURL,omitempty"`
|
||||||
Description *string `yaml:"description"`
|
Description *string `yaml:"description,omitempty"`
|
||||||
DescriptionLang []*string `yaml:"descriptionLang"`
|
DescriptionLang []*string `yaml:"descriptionLang,omitempty"`
|
||||||
ConsoleLinkName *string `yaml:"consoleLinkName"`
|
ConsoleLinkName *string `yaml:"consoleLinkName,omitempty"`
|
||||||
ConsoleLinkNameLang []*string `yaml:"consoleLinkNameLang"`
|
ConsoleLinkNameLang []*string `yaml:"consoleLinkNameLang,omitempty"`
|
||||||
ConsoleLinkURL *string `yaml:"consoleLinkURL"`
|
ConsoleLinkURL *string `yaml:"consoleLinkURL,omitempty"`
|
||||||
ConsoleIcon *string `yaml:"consoleIcon"`
|
ConsoleIcon *string `yaml:"consoleIcon,omitempty"`
|
||||||
ConsoleIconCode *string `yaml:"consoleIconCode"`
|
ConsoleIconCode *string `yaml:"consoleIconCode,omitempty"`
|
||||||
MinVersion *string `yaml:"minVersion"`
|
MinVersion *string `yaml:"minVersion,omitempty"`
|
||||||
MaxVerion *string `yaml:"maxVersion"`
|
MaxVerion *string `yaml:"maxVersion,omitempty"`
|
||||||
MinJava *string `yaml:"minJava"`
|
MinJava *string `yaml:"minJava,omitempty"`
|
||||||
MinJetty *string `yaml:"minJetty"`
|
MinJetty *string `yaml:"minJetty,omitempty"`
|
||||||
MaxJetty *string `yaml:"maxJetty"`
|
MaxJetty *string `yaml:"maxJetty,omitempty"`
|
||||||
NoStop *bool `yaml:"disableStop"`
|
NoStop *bool `yaml:"disableStop,omitempty"`
|
||||||
NoStart *bool `yaml:"dont-start-at-install"`
|
NoStart *bool `yaml:"dont-start-at-install,omitempty"`
|
||||||
Restart *bool `yaml:"restart-at-install"`
|
Restart *bool `yaml:"restart-at-install,omitempty"`
|
||||||
OnlyUpdate *bool `yaml:"only-update"`
|
OnlyUpdate *bool `yaml:"only-update,omitempty"`
|
||||||
OnlyInstall *bool `yaml:"only-install"`
|
OnlyInstall *bool `yaml:"only-install,omitempty"`
|
||||||
ConsoleLinkTip *string `yaml:"consoleLinkTip"`
|
ConsoleLinkTip *string `yaml:"consoleLinkTip,omitempty"`
|
||||||
ConsoleLinkTipLang []*string `yaml:"consoleLinkTipLang"`
|
ConsoleLinkTipLang []*string `yaml:"consoleLinkTipLang,omitempty"`
|
||||||
SignerDirectory *string `yaml:"signerDirectory"`
|
SignerDirectory *string `yaml:"signerDirectory,omitempty"`
|
||||||
FileType *int `yaml:"fileType"`
|
FileType *int `yaml:"fileType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pc *PluginConfig) Print() string {
|
func (pc *PluginConfig) Print() string {
|
||||||
@ -79,7 +79,8 @@ func (pc *PluginConfig) Print() string {
|
|||||||
r += pc.PrintOnlyInstall() //25
|
r += pc.PrintOnlyInstall() //25
|
||||||
r += pc.PrintConsoleLinkTip() //26
|
r += pc.PrintConsoleLinkTip() //26
|
||||||
//27
|
//27
|
||||||
return Replace(r)
|
//return Replace(r)
|
||||||
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pc *PluginConfig) PrintPluginName() string {
|
func (pc *PluginConfig) PrintPluginName() string {
|
||||||
|
Reference in New Issue
Block a user