From a60c71469d0e129c64538e56785d1bc003c05620 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Mon, 17 Feb 2020 14:50:02 -0600 Subject: [PATCH] Rename project to Sip Signed-off-by: jolheiser --- .gitignore | 4 ++-- README.md | 30 +++++++++++++++--------------- cmd/cmd.go | 4 ++-- cmd/config.go | 4 ++-- cmd/issues.go | 6 +++--- cmd/issues_create.go | 2 +- cmd/login.go | 4 ++-- cmd/logout.go | 2 +- cmd/pulls_checkout.go | 4 ++-- cmd/pulls_create.go | 4 ++-- cmd/pulls_status.go | 4 ++-- cmd/repo.go | 2 +- go.mod | 2 +- main.go | 4 ++-- modules/config/config.go | 8 ++++---- modules/git/git.go | 2 +- 16 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 0beeafb..6a5a6de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # GoLand .idea/ -# Tea -/tea* \ No newline at end of file +# Sip +/sip* \ No newline at end of file diff --git a/README.md b/README.md index 303c627..9844a1a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Tea (alternative) +# Sip (alternative) CLI for interacting with Gitea ### Features @@ -7,23 +7,23 @@ Understands the concepts of an origin vs remote repository. By default uses remotes `origin` and `upstream`. If no `upstream` repository is found, `upstream` becomes synonymous with `origin` for the sake of defaults. -* Configuration `tea config` - * Change the default `origin` remote name `tea config origin` - * Change the default `upstream` remote name `tea config upstrea` -* Login `tea login` +* Configuration `sip config` + * Change the default `origin` remote name `sip config origin` + * Change the default `upstream` remote name `sip config upstrea` +* Login `sip login` * Add a user token for API usage - * Generate a new token from CLI `tea login auto` + * Generate a new token from CLI `sip login auto` * Authenticate with username/password to get a new token without leaving the terminal - * List available logins `tea login list` -* Logout `tea logout` + * List available logins `sip login list` +* Logout `sip logout` * Remove user tokens -* Repository status `tea repo` +* Repository status `sip repo` * Get basic information about the `upstream` repository -* Issue search `tea issues` +* Issue search `sip issues` * Search issues based on keyword(s) - * Create a new issue `tea issues create` -* Pull request search `tea pulls` + * Create a new issue `sip issues create` +* Pull request search `sip pulls` * Search pull requests based on keyword(s) - * Create a new pull request `tea pulls create` - * Check pull request status (default based on current branch) `tea pulls status` - * Checkout a pull request to test locally `tea pulls checkout` \ No newline at end of file + * Create a new pull request `sip pulls create` + * Check pull request status (default based on current branch) `sip pulls status` + * Checkout a pull request to test locally `sip pulls checkout` \ No newline at end of file diff --git a/cmd/cmd.go b/cmd/cmd.go index 36bd7cd..245221f 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -4,8 +4,8 @@ import ( "code.gitea.io/sdk/gitea" "errors" "fmt" - "gitea.com/jolheiser/tea/modules/config" - "gitea.com/jolheiser/tea/modules/git" + "gitea.com/jolheiser/sip/modules/config" + "gitea.com/jolheiser/sip/modules/git" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" "strings" diff --git a/cmd/config.go b/cmd/config.go index 4fa7a03..c17ae36 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -2,7 +2,7 @@ package cmd import ( "gitea.com/jolheiser/beaver" - "gitea.com/jolheiser/tea/modules/config" + "gitea.com/jolheiser/sip/modules/config" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) @@ -10,7 +10,7 @@ import ( var Config = cli.Command{ Name: "config", Aliases: []string{"cfg"}, - Usage: "Modify tea config", + Usage: "Modify sip config", Action: doConfig, Subcommands: []*cli.Command{ { diff --git a/cmd/issues.go b/cmd/issues.go index b3b08a8..b16642d 100644 --- a/cmd/issues.go +++ b/cmd/issues.go @@ -4,9 +4,9 @@ import ( "code.gitea.io/sdk/gitea" "fmt" "gitea.com/jolheiser/beaver/color" - "gitea.com/jolheiser/tea/modules/markdown" - "gitea.com/jolheiser/tea/modules/sdk" - "gitea.com/jolheiser/tea/modules/stdout" + "gitea.com/jolheiser/sip/modules/markdown" + "gitea.com/jolheiser/sip/modules/sdk" + "gitea.com/jolheiser/sip/modules/stdout" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" "strconv" diff --git a/cmd/issues_create.go b/cmd/issues_create.go index 2fd1a4a..9f3a2e8 100644 --- a/cmd/issues_create.go +++ b/cmd/issues_create.go @@ -4,7 +4,7 @@ import ( "code.gitea.io/sdk/gitea" "fmt" "gitea.com/jolheiser/beaver/color" - "gitea.com/jolheiser/tea/modules/markdown" + "gitea.com/jolheiser/sip/modules/markdown" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) diff --git a/cmd/login.go b/cmd/login.go index b43a78d..3211d7c 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -4,7 +4,7 @@ import ( "code.gitea.io/sdk/gitea" "errors" "gitea.com/jolheiser/beaver" - "gitea.com/jolheiser/tea/modules/config" + "gitea.com/jolheiser/sip/modules/config" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) @@ -81,7 +81,7 @@ func doLoginAuto(ctx *cli.Context) error { }, { Name: "token", - Prompt: &survey.Input{Message: "Name for this token", Default: "tea"}, + Prompt: &survey.Input{Message: "Name for this token", Default: "sip"}, Validate: survey.Required, }, { diff --git a/cmd/logout.go b/cmd/logout.go index e0e5c76..614ba98 100644 --- a/cmd/logout.go +++ b/cmd/logout.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" "gitea.com/jolheiser/beaver" - "gitea.com/jolheiser/tea/modules/config" + "gitea.com/jolheiser/sip/modules/config" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) diff --git a/cmd/pulls_checkout.go b/cmd/pulls_checkout.go index a81357c..7b65634 100644 --- a/cmd/pulls_checkout.go +++ b/cmd/pulls_checkout.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" "gitea.com/jolheiser/beaver" - "gitea.com/jolheiser/tea/modules/config" + "gitea.com/jolheiser/sip/modules/config" "github.com/AlecAivazis/survey/v2" "github.com/huandu/xstrings" "github.com/urfave/cli/v2" @@ -25,7 +25,7 @@ func doPullCheckout(ctx *cli.Context) error { questions := []*survey.Question{ { Name: "index", - Prompt: &survey.Input{Message: "Pull request number", Help: "Don't worry if you aren't sure! Just say -1 and we'll search for it instead!"}, + Prompt: &survey.Input{Message: "Pull request number", Help: "Don't worry if you aren't sure! Just say -1 and we'll search for it inssipd!"}, Validate: validatePRNum, }, } diff --git a/cmd/pulls_create.go b/cmd/pulls_create.go index 5504a4d..5ca71d5 100644 --- a/cmd/pulls_create.go +++ b/cmd/pulls_create.go @@ -4,8 +4,8 @@ import ( "code.gitea.io/sdk/gitea" "fmt" "gitea.com/jolheiser/beaver/color" - "gitea.com/jolheiser/tea/modules/git" - "gitea.com/jolheiser/tea/modules/markdown" + "gitea.com/jolheiser/sip/modules/git" + "gitea.com/jolheiser/sip/modules/markdown" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) diff --git a/cmd/pulls_status.go b/cmd/pulls_status.go index 4638700..4d4e396 100644 --- a/cmd/pulls_status.go +++ b/cmd/pulls_status.go @@ -4,8 +4,8 @@ import ( "code.gitea.io/sdk/gitea" "fmt" "gitea.com/jolheiser/beaver/color" - "gitea.com/jolheiser/tea/modules/git" - "gitea.com/jolheiser/tea/modules/sdk" + "gitea.com/jolheiser/sip/modules/git" + "gitea.com/jolheiser/sip/modules/sdk" "github.com/urfave/cli/v2" "strconv" ) diff --git a/cmd/repo.go b/cmd/repo.go index e4b3697..e50bc58 100644 --- a/cmd/repo.go +++ b/cmd/repo.go @@ -4,7 +4,7 @@ import ( "code.gitea.io/sdk/gitea" "gitea.com/jolheiser/beaver" "gitea.com/jolheiser/beaver/color" - "gitea.com/jolheiser/tea/modules/sdk" + "gitea.com/jolheiser/sip/modules/sdk" "github.com/urfave/cli/v2" "strconv" ) diff --git a/go.mod b/go.mod index c0302c7..a0045ad 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.com/jolheiser/tea +module gitea.com/jolheiser/sip go 1.13 diff --git a/main.go b/main.go index f07978c..da204ce 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,7 @@ package main import ( "gitea.com/jolheiser/beaver" - "gitea.com/jolheiser/tea/cmd" + "gitea.com/jolheiser/sip/cmd" "github.com/urfave/cli/v2" "os" ) @@ -11,7 +11,7 @@ var Version = "develop" func main() { app := cli.NewApp() - app.Name = "Tea" + app.Name = "Sip" app.Usage = "Command line tool to interact with Gitea" app.Version = Version app.Commands = []*cli.Command{ diff --git a/modules/config/config.go b/modules/config/config.go index 8a9e261..bbe1a74 100644 --- a/modules/config/config.go +++ b/modules/config/config.go @@ -35,20 +35,20 @@ func init() { if err != nil { beaver.Fatalf("could not locate home directory: %v", err) } - configPath = fmt.Sprintf("%s/.tea/config.toml", home) + configPath = fmt.Sprintf("%s/.sip/config.toml", home) if _, err := os.Stat(configPath); os.IsNotExist(err) { if err := os.MkdirAll(path.Dir(configPath), os.ModePerm); err != nil { - beaver.Fatalf("could not create Tea home: %v", err) + beaver.Fatalf("could not create Sip home: %v", err) } if _, err := os.Create(configPath); err != nil { - beaver.Fatalf("could not create Tea config: %v", err) + beaver.Fatalf("could not create Sip config: %v", err) } } if _, err := toml.DecodeFile(configPath, &cfg); err != nil { - beaver.Fatalf("could not decode Tea config: %v", err) + beaver.Fatalf("could not decode Sip config: %v", err) } Origin = cfg.Origin diff --git a/modules/git/git.go b/modules/git/git.go index b2144d3..41d0b7b 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -10,7 +10,7 @@ func GetRepo(remoteName string) []string { cmd := exec.Command("git", "remote", "get-url", remoteName) out, err := cmd.Output() if err != nil { - return []string{"https://gitea.com", "jolheiser", "tea"} + return []string{"https://gitea.com", "jolheiser", "sip"} } remote := strings.TrimSpace(string(out))