Skip to content

Commit 98b8aa2

Browse files
committed
refactor code
1 parent 1e44a11 commit 98b8aa2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cmd/check.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ func GetCheckCmd() *cobra.Command {
4343
}
4444

4545
isLinux := runtime.GOOS == "linux"
46+
requireServiceFileForValidatorOnLinux := nodeType == types.ValidatorNode && isLinux
4647

4748
serviceFilePath, _ := cmd.Flags().GetString(flagServiceFile)
48-
if nodeType == types.ValidatorNode && serviceFilePath == "" && isLinux {
49-
exitWithErrorMsgf("ERR: service file is required on Linux to check validator setting\n")
49+
if requireServiceFileForValidatorOnLinux && serviceFilePath == "" {
50+
exitWithErrorMsgf("ERR: --%s is required on Linux to check validator setting\n", flagServiceFile)
5051
return
5152
} else if nodeType != types.ValidatorNode && serviceFilePath != "" {
5253
exitWithErrorMsgf("ERR: remove flag \"--%s\", only be used for validator on Linux\n", flagServiceFile)
@@ -70,7 +71,7 @@ func GetCheckCmd() *cobra.Command {
7071
checkHomeKeyring(home, nodeType == types.ValidatorNode)
7172
checkHomeConfig(home, nodeType)
7273
checkHomeData(home, nodeType)
73-
if nodeType == types.ValidatorNode && isLinux {
74+
if requireServiceFileForValidatorOnLinux {
7475
checkServiceFileForValidatorOnLinux(home, serviceFilePath)
7576
}
7677

constants/varcons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package constants
44

55
//goland:noinspection GoSnakeCaseUsage
66
var (
7-
VERSION = "1.1.2"
7+
VERSION = "1.1.3"
88
COMMIT_HASH = ""
99
BUILD_DATE = ""
1010
)

0 commit comments

Comments
 (0)