mirror of
https://gitea.com/jolheiser/sip
synced 2024-11-22 19:51:58 +01:00
Rename project to Sip
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
8958c4a312
commit
a60c71469d
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
# GoLand
|
# GoLand
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# Tea
|
# Sip
|
||||||
/tea*
|
/sip*
|
30
README.md
30
README.md
@ -1,4 +1,4 @@
|
|||||||
# Tea (alternative)
|
# Sip (alternative)
|
||||||
CLI for interacting with Gitea
|
CLI for interacting with Gitea
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
@ -7,23 +7,23 @@ Understands the concepts of an origin vs remote repository.
|
|||||||
By default uses remotes `origin` and `upstream`.
|
By default uses remotes `origin` and `upstream`.
|
||||||
If no `upstream` repository is found, `upstream` becomes synonymous with `origin` for the sake of defaults.
|
If no `upstream` repository is found, `upstream` becomes synonymous with `origin` for the sake of defaults.
|
||||||
|
|
||||||
* Configuration `tea config`
|
* Configuration `sip config`
|
||||||
* Change the default `origin` remote name `tea config origin`
|
* Change the default `origin` remote name `sip config origin`
|
||||||
* Change the default `upstream` remote name `tea config upstrea`
|
* Change the default `upstream` remote name `sip config upstrea`
|
||||||
* Login `tea login`
|
* Login `sip login`
|
||||||
* Add a user token for API usage
|
* 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
|
* Authenticate with username/password to get a new token without leaving the terminal
|
||||||
* List available logins `tea login list`
|
* List available logins `sip login list`
|
||||||
* Logout `tea logout`
|
* Logout `sip logout`
|
||||||
* Remove user tokens
|
* Remove user tokens
|
||||||
* Repository status `tea repo`
|
* Repository status `sip repo`
|
||||||
* Get basic information about the `upstream` repository
|
* Get basic information about the `upstream` repository
|
||||||
* Issue search `tea issues`
|
* Issue search `sip issues`
|
||||||
* Search issues based on keyword(s)
|
* Search issues based on keyword(s)
|
||||||
* Create a new issue `tea issues create`
|
* Create a new issue `sip issues create`
|
||||||
* Pull request search `tea pulls`
|
* Pull request search `sip pulls`
|
||||||
* Search pull requests based on keyword(s)
|
* Search pull requests based on keyword(s)
|
||||||
* Create a new pull request `tea pulls create`
|
* Create a new pull request `sip pulls create`
|
||||||
* Check pull request status (default based on current branch) `tea pulls status`
|
* Check pull request status (default based on current branch) `sip pulls status`
|
||||||
* Checkout a pull request to test locally `tea pulls checkout`
|
* Checkout a pull request to test locally `sip pulls checkout`
|
@ -4,8 +4,8 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/tea/modules/config"
|
"gitea.com/jolheiser/sip/modules/config"
|
||||||
"gitea.com/jolheiser/tea/modules/git"
|
"gitea.com/jolheiser/sip/modules/git"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -2,7 +2,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/tea/modules/config"
|
"gitea.com/jolheiser/sip/modules/config"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
@ -10,7 +10,7 @@ import (
|
|||||||
var Config = cli.Command{
|
var Config = cli.Command{
|
||||||
Name: "config",
|
Name: "config",
|
||||||
Aliases: []string{"cfg"},
|
Aliases: []string{"cfg"},
|
||||||
Usage: "Modify tea config",
|
Usage: "Modify sip config",
|
||||||
Action: doConfig,
|
Action: doConfig,
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
{
|
{
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver/color"
|
"gitea.com/jolheiser/beaver/color"
|
||||||
"gitea.com/jolheiser/tea/modules/markdown"
|
"gitea.com/jolheiser/sip/modules/markdown"
|
||||||
"gitea.com/jolheiser/tea/modules/sdk"
|
"gitea.com/jolheiser/sip/modules/sdk"
|
||||||
"gitea.com/jolheiser/tea/modules/stdout"
|
"gitea.com/jolheiser/sip/modules/stdout"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver/color"
|
"gitea.com/jolheiser/beaver/color"
|
||||||
"gitea.com/jolheiser/tea/modules/markdown"
|
"gitea.com/jolheiser/sip/modules/markdown"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"errors"
|
"errors"
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/tea/modules/config"
|
"gitea.com/jolheiser/sip/modules/config"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
@ -81,7 +81,7 @@ func doLoginAuto(ctx *cli.Context) error {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "token",
|
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,
|
Validate: survey.Required,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/tea/modules/config"
|
"gitea.com/jolheiser/sip/modules/config"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/tea/modules/config"
|
"gitea.com/jolheiser/sip/modules/config"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/huandu/xstrings"
|
"github.com/huandu/xstrings"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
@ -25,7 +25,7 @@ func doPullCheckout(ctx *cli.Context) error {
|
|||||||
questions := []*survey.Question{
|
questions := []*survey.Question{
|
||||||
{
|
{
|
||||||
Name: "index",
|
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,
|
Validate: validatePRNum,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver/color"
|
"gitea.com/jolheiser/beaver/color"
|
||||||
"gitea.com/jolheiser/tea/modules/git"
|
"gitea.com/jolheiser/sip/modules/git"
|
||||||
"gitea.com/jolheiser/tea/modules/markdown"
|
"gitea.com/jolheiser/sip/modules/markdown"
|
||||||
"github.com/AlecAivazis/survey/v2"
|
"github.com/AlecAivazis/survey/v2"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.com/jolheiser/beaver/color"
|
"gitea.com/jolheiser/beaver/color"
|
||||||
"gitea.com/jolheiser/tea/modules/git"
|
"gitea.com/jolheiser/sip/modules/git"
|
||||||
"gitea.com/jolheiser/tea/modules/sdk"
|
"gitea.com/jolheiser/sip/modules/sdk"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/beaver/color"
|
"gitea.com/jolheiser/beaver/color"
|
||||||
"gitea.com/jolheiser/tea/modules/sdk"
|
"gitea.com/jolheiser/sip/modules/sdk"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module gitea.com/jolheiser/tea
|
module gitea.com/jolheiser/sip
|
||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
|
4
main.go
4
main.go
@ -2,7 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"gitea.com/jolheiser/beaver"
|
"gitea.com/jolheiser/beaver"
|
||||||
"gitea.com/jolheiser/tea/cmd"
|
"gitea.com/jolheiser/sip/cmd"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@ -11,7 +11,7 @@ var Version = "develop"
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "Tea"
|
app.Name = "Sip"
|
||||||
app.Usage = "Command line tool to interact with Gitea"
|
app.Usage = "Command line tool to interact with Gitea"
|
||||||
app.Version = Version
|
app.Version = Version
|
||||||
app.Commands = []*cli.Command{
|
app.Commands = []*cli.Command{
|
||||||
|
@ -35,20 +35,20 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
beaver.Fatalf("could not locate home directory: %v", err)
|
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.Stat(configPath); os.IsNotExist(err) {
|
||||||
if err := os.MkdirAll(path.Dir(configPath), os.ModePerm); err != nil {
|
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 {
|
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 {
|
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
|
Origin = cfg.Origin
|
||||||
|
@ -10,7 +10,7 @@ func GetRepo(remoteName string) []string {
|
|||||||
cmd := exec.Command("git", "remote", "get-url", remoteName)
|
cmd := exec.Command("git", "remote", "get-url", remoteName)
|
||||||
out, err := cmd.Output()
|
out, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{"https://gitea.com", "jolheiser", "tea"}
|
return []string{"https://gitea.com", "jolheiser", "sip"}
|
||||||
}
|
}
|
||||||
|
|
||||||
remote := strings.TrimSpace(string(out))
|
remote := strings.TrimSpace(string(out))
|
||||||
|
Loading…
Reference in New Issue
Block a user