Skip to content

Commit

Permalink
chore(destroy): add current path . as the default path (#422)
Browse files Browse the repository at this point in the history
* chore(destroy): add current path `.` as the default path

Signed-off-by: Triple-Z <me@triplez.cn>

* fix(destroy): specified `--name` with default `--path` value

Signed-off-by: Triple-Z <me@triplez.cn>
  • Loading branch information
Triple-Z committed Jun 18, 2022
1 parent 750db5a commit 2e287c9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/app/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ var CommandDestroy = &cli.Command{
Usage: "destroys the envd environment",
Flags: []cli.Flag{
&cli.PathFlag{
Name: "path",
Usage: "Path to the directory containing the build.envd",
Aliases: []string{"p"},
Name: "path",
Usage: "Path to the directory containing the build.envd",
Aliases: []string{"p"},
DefaultText: "current directory",
},
&cli.PathFlag{
Name: "name",
Expand All @@ -53,7 +54,7 @@ func destroy(clicontext *cli.Context) error {
return errors.New("Cannot specify --path and --name at the same time.")
}
if path == "" && name == "" {
return errors.New("One of the following flags is required: --path and --name.")
path = "."
}
dockerClient, err := docker.NewClient(clicontext.Context)
if err != nil {
Expand Down

0 comments on commit 2e287c9

Please sign in to comment.