Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 4590f46

Browse files
author
Noah Lee
authored
Rename the deploy command (#410)
* Replace the `deploy` command * Fix the error message
1 parent 42071a8 commit 4590f46

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: cmd/cli/deployment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var deploymentCommand = &cli.Command{
99
Subcommands: []*cli.Command{
1010
deploymentListCommand,
1111
deploymentGetCommand,
12-
deploymentDeployCommand,
12+
deploymentCreateCommand,
1313
deploymentUpdateCommand,
1414
},
1515
}

Diff for: cmd/cli/deployment_deploy.go renamed to cmd/cli/deployment_create.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/gitploy-io/gitploy/pkg/api"
77
)
88

9-
var deploymentDeployCommand = &cli.Command{
10-
Name: "deploy",
9+
var deploymentCreateCommand = &cli.Command{
10+
Name: "create",
1111
Usage: "Deploy a specific ref(branch, SHA, tag) to the environment.",
1212
ArgsUsage: "<owner>/<repo>",
1313
Flags: []cli.Flag{

Diff for: cmd/cli/shared.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func buildClient(cli *cli.Context) *api.Client {
2626
func splitFullName(name string) (string, string, error) {
2727
ss := strings.Split(name, "/")
2828
if len(ss) != 2 {
29-
return "", "", fmt.Errorf("'%s' is invalid format", name)
29+
return "", "", fmt.Errorf("'%s' is invalid repository name", name)
3030
}
3131

3232
return ss[0], ss[1], nil
@@ -36,7 +36,7 @@ func splitFullName(name string) (string, string, error) {
3636
func printJson(cli *cli.Context, v interface{}) error {
3737
output, err := json.MarshalIndent(v, "", " ")
3838
if err != nil {
39-
return fmt.Errorf("Failed to marshal: %w", err)
39+
return fmt.Errorf("Failed to print JSON format: %w", err)
4040
}
4141

4242
if query := cli.String("query"); query != "" {

0 commit comments

Comments
 (0)