Skip to content

Commit 8523b89

Browse files
committed
removing --hard option from clean cmd
1 parent 42e6f1b commit 8523b89

File tree

7 files changed

+7
-69
lines changed

7 files changed

+7
-69
lines changed

cmd/commands.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,6 @@ avalanche network clean [subcommand] [flags]
20672067
**Flags:**
20682068
20692069
```bash
2070-
--hard Also clean downloaded avalanchego and plugin binaries
20712070
-h, --help help for clean
20722071
--config string config file (default is $HOME/.avalanche-cli/config.json)
20732072
--log-level string log level for the application (default "ERROR")

cmd/networkcmd/clean.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package networkcmd
55
import (
66
"errors"
77
"os"
8-
"path/filepath"
98

109
"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
1110
"github.com/ava-labs/avalanche-cli/pkg/constants"
@@ -19,8 +18,6 @@ import (
1918
"github.com/spf13/cobra"
2019
)
2120

22-
var hard bool
23-
2421
func newCleanCmd() *cobra.Command {
2522
cmd := &cobra.Command{
2623
Use: "clean",
@@ -32,13 +29,6 @@ configuration.`,
3229
Args: cobrautils.ExactArgs(0),
3330
}
3431

35-
cmd.Flags().BoolVar(
36-
&hard,
37-
"hard",
38-
false,
39-
"Also clean downloaded avalanchego and plugin binaries",
40-
)
41-
4232
return cmd
4333
}
4434

@@ -59,12 +49,6 @@ func clean(*cobra.Command, []string) error {
5949
return err
6050
}
6151

62-
if hard {
63-
ux.Logger.PrintToUser("hard clean requested via flag, removing all downloaded avalanchego and plugin binaries")
64-
binDir := filepath.Join(app.GetBaseDir(), constants.AvalancheCliBinDir)
65-
cleanBins(binDir)
66-
}
67-
6852
if err := app.ResetPluginsDir(); err != nil {
6953
return err
7054
}

tests/e2e/commands/network.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,6 @@ func CleanNetwork() {
3030
gomega.Expect(err).Should(gomega.BeNil())
3131
}
3232

33-
/* #nosec G204 */
34-
func CleanNetworkHard() {
35-
cmd := exec.Command(
36-
CLIBinary,
37-
NetworkCmd,
38-
"clean",
39-
"--hard",
40-
"--"+constants.SkipUpdateFlag,
41-
)
42-
output, err := cmd.CombinedOutput()
43-
if err != nil {
44-
fmt.Println(cmd.String())
45-
fmt.Println(string(output))
46-
utils.PrintStdErr(err)
47-
}
48-
gomega.Expect(err).Should(gomega.BeNil())
49-
}
50-
5133
/* #nosec G204 */
5234
func StartNetwork() string {
5335
return StartNetworkWithVersion("")

tests/e2e/testcases/network/suite.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,4 @@ var _ = ginkgo.Describe("[Network]", ginkgo.Ordered, func() {
116116

117117
commands.DeleteSubnetConfig(subnetName)
118118
})
119-
120-
ginkgo.It("clean hard deletes plugin binaries non SOV", func() {
121-
commands.CreateSubnetEvmConfigNonSOV(subnetName, utils.SubnetEvmGenesisPath, false)
122-
deployOutput := commands.DeploySubnetLocallyNonSOV(subnetName)
123-
rpcs, err := utils.ParseRPCsFromOutput(deployOutput)
124-
if err != nil {
125-
fmt.Println(deployOutput)
126-
}
127-
gomega.Expect(err).Should(gomega.BeNil())
128-
gomega.Expect(rpcs).Should(gomega.HaveLen(1))
129-
130-
// check that plugin binaries exist
131-
plugins, err := utils.GetPluginBinaries()
132-
// should have only subnet-evm binary
133-
gomega.Expect(len(plugins)).Should(gomega.Equal(1))
134-
gomega.Expect(err).Should(gomega.BeNil())
135-
136-
commands.CleanNetwork()
137-
138-
// check that plugin binaries exist
139-
plugins, err = utils.GetPluginBinaries()
140-
// should be empty
141-
gomega.Expect(len(plugins)).Should(gomega.Equal(0))
142-
gomega.Expect(err).Should(gomega.BeNil())
143-
144-
commands.DeleteSubnetConfig(subnetName)
145-
})
146119
})

tests/e2e/testcases/packageman/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var _ = ginkgo.Describe("[Package Management]", ginkgo.Ordered, func() {
3030
gomega.Expect(err).Should(gomega.BeNil())
3131
})
3232
ginkgo.BeforeEach(func() {
33-
commands.CleanNetworkHard()
33+
commands.CleanNetwork()
3434
})
3535

3636
ginkgo.AfterEach(func() {

tests/e2e/testcases/upgrade/non-sov/suite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
// need to have this outside the normal suite because of the BeforeEach
5252
var _ = ginkgo.Describe("[Upgrade expect network failure non SOV]", ginkgo.Ordered, func() {
5353
ginkgo.AfterEach(func() {
54-
commands.CleanNetworkHard()
54+
commands.CleanNetwork()
5555
err := utils.DeleteConfigs(subnetName)
5656
gomega.Expect(err).Should(gomega.BeNil())
5757
})
@@ -91,7 +91,7 @@ var _ = ginkgo.Describe("[Upgrade expect network failure non SOV]", ginkgo.Order
9191
// and then check the file is there and has the correct content.
9292
var _ = ginkgo.Describe("[Upgrade public network non SOV]", ginkgo.Ordered, func() {
9393
ginkgo.AfterEach(func() {
94-
commands.CleanNetworkHard()
94+
commands.CleanNetwork()
9595
err := utils.DeleteConfigs(subnetName)
9696
gomega.Expect(err).Should(gomega.BeNil())
9797
})
@@ -158,7 +158,7 @@ var _ = ginkgo.Describe("[Upgrade local network non SOV]", ginkgo.Ordered, func(
158158
})
159159

160160
ginkgo.AfterEach(func() {
161-
commands.CleanNetworkHard()
161+
commands.CleanNetwork()
162162
err := utils.DeleteConfigs(subnetName)
163163
gomega.Expect(err).Should(gomega.BeNil())
164164
err = utils.DeleteConfigs(secondSubnetName)

tests/e2e/testcases/upgrade/sov/suite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
// need to have this outside the normal suite because of the BeforeEach
5252
var _ = ginkgo.Describe("[Upgrade expect network failure SOV]", ginkgo.Ordered, func() {
5353
ginkgo.AfterEach(func() {
54-
commands.CleanNetworkHard()
54+
commands.CleanNetwork()
5555
err := utils.DeleteConfigs(subnetName)
5656
gomega.Expect(err).Should(gomega.BeNil())
5757
})
@@ -91,7 +91,7 @@ var _ = ginkgo.Describe("[Upgrade expect network failure SOV]", ginkgo.Ordered,
9191
// and then check the file is there and has the correct content.
9292
var _ = ginkgo.Describe("[Upgrade public network SOV]", ginkgo.Ordered, func() {
9393
ginkgo.AfterEach(func() {
94-
commands.CleanNetworkHard()
94+
commands.CleanNetwork()
9595
err := utils.DeleteConfigs(subnetName)
9696
gomega.Expect(err).Should(gomega.BeNil())
9797
})
@@ -158,7 +158,7 @@ var _ = ginkgo.Describe("[Upgrade local network SOV]", ginkgo.Ordered, func() {
158158
})
159159

160160
ginkgo.AfterEach(func() {
161-
commands.CleanNetworkHard()
161+
commands.CleanNetwork()
162162
err := utils.DeleteConfigs(subnetName)
163163
gomega.Expect(err).Should(gomega.BeNil())
164164
err = utils.DeleteConfigs(secondSubnetName)

0 commit comments

Comments
 (0)