Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero committed Jul 20, 2023
1 parent c563530 commit d659940
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions cmd/control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ func newStartCommand() *cobra.Command {
false,
"true to assign dynamic ports",
)
if err := cmd.MarkPersistentFlagRequired("avalanchego-path"); err != nil {
panic(err)
}
return cmd
}

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
})

ginkgo.It("can start", func() {
ginkgo.By("start request with invalid exec path should fail", func() {
ginkgo.By("start request with empty exec path should fail", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
_, err := cli.Start(ctx, "")
cancel()
gomega.Ω(err.Error()).Should(gomega.ContainSubstring(utils.ErrInvalidExecPath.Error()))
gomega.Ω(err.Error()).Should(gomega.ContainSubstring(utils.ErrEmptyExecPath.Error()))
})

ginkgo.By("start request with invalid exec path should fail", func() {
Expand Down
4 changes: 2 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ func NetworkIDFromGenesis(genesis []byte) (uint32, error) {
}

var (
ErrInvalidExecPath = errors.New("avalanche exec is invalid")
ErrEmptyExecPath = errors.New("avalanche exec is not defined")
ErrNotExists = errors.New("avalanche exec not exists")
ErrNotExistsPlugin = errors.New("plugin exec not exists")
)

func CheckExecPath(exec string) error {
if exec == "" {
return ErrInvalidExecPath
return ErrEmptyExecPath
}
_, err := os.Stat(exec)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestCheckExecPath(t *testing.T) {
},
{
execPath: "",
expectedErr: ErrInvalidExecPath,
expectedErr: ErrEmptyExecPath,
},
{
execPath: "invalid",
Expand Down

0 comments on commit d659940

Please sign in to comment.