1
0
Fork 0
mirror of https://gitea.com/jolheiser/sip synced 2024-05-06 15:56:04 +02:00

Rename project to Sip

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser 2020-02-17 14:50:02 -06:00
parent 8958c4a312
commit a60c71469d
No known key found for this signature in database
GPG Key ID: B853ADA5DA7BBF7A
16 changed files with 43 additions and 43 deletions

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
# GoLand
.idea/
# Tea
/tea*
# Sip
/sip*

View File

@ -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`
* 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`

View File

@ -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"

View File

@ -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{
{

View File

@ -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"

View File

@ -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"
)

View File

@ -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,
},
{

View File

@ -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"
)

View File

@ -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,
},
}

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

2
go.mod
View File

@ -1,4 +1,4 @@
module gitea.com/jolheiser/tea
module gitea.com/jolheiser/sip
go 1.13

View File

@ -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{

View File

@ -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

View File

@ -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))