diff --git a/.goreleaser.yml b/.goreleaser.yml index e608213..c8dd31c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,6 +11,7 @@ builds: - linux - windows - darwin + binary: jt archives: - replacements: darwin: Darwin @@ -30,15 +31,31 @@ changelog: - '^test:' brews: - - name: jira-tool - github: + # Name template of the recipe + # Default to project name + name: jt + + # GitHub/GitLab repository to push the formula to + # Gitea is not supported yet, but the support coming + tap: owner: StevenACoffman - name: homebrew-jira-tool + name: homebrew-jt + # Optionally a token can be provided, if it differs from the token provided to GoReleaser + # token: "{{ .Env.GITHUB_AUTH_TOKEN }}" folder: Formula - homepage: "https://github.com/StevenACoffman/jira-tool" - description: jt - jira-tool is a CLI tool for viewing and manipulating JIRA issues. -test: | - system "#{bin}/jt", "--version" + # Your app's homepage. + # Default is empty. + homepage: "https://github.com/StevenACoffman/jt" + + # Template of your app's description. + # Default is empty. + description: jt is a CLI tool for viewing and manipulating JIRA issues. + + # SPDX identifier of your app's license. + # Default is empty. + license: "MIT" + + # Custom install script for brew. + # Default is 'bin.install "program"'. install: | - bin.install "jt" => "jt" - prefix.install_metafiles \ No newline at end of file + bin.install "jt" diff --git a/README.md b/README.md index 2489776..3b6fcd8 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,8 @@ Shared Flags: ### tips Use "jt [command] --help" for more information about a command. +### installation +``` +brew +``` + diff --git a/cmd/block.go b/cmd/block.go index 3c1b24c..91234dd 100644 --- a/cmd/block.go +++ b/cmd/block.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/done.go b/cmd/done.go index a938605..ca7db51 100644 --- a/cmd/done.go +++ b/cmd/done.go @@ -6,7 +6,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/land.go b/cmd/land.go index 3a13c3e..5e9406d 100644 --- a/cmd/land.go +++ b/cmd/land.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/onit.go b/cmd/onit.go index 5140a19..41c2661 100644 --- a/cmd/onit.go +++ b/cmd/onit.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/review.go b/cmd/review.go index a528cb7..7e80dc5 100644 --- a/cmd/review.go +++ b/cmd/review.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/root.go b/cmd/root.go index e1203d4..e524374 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "github.com/spf13/cobra" "os" @@ -75,7 +75,7 @@ func initConfig() { os.Exit(1) } - // Search config in home directory with name ".jira-tool" (without extension). + // Search config in home directory with name ".jt" (without extension). v.AddConfigPath(home+"/.config") v.SetConfigName("jira") } diff --git a/cmd/take.go b/cmd/take.go index 597ec27..26d848f 100644 --- a/cmd/take.go +++ b/cmd/take.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/todo.go b/cmd/todo.go index 6fdb35e..f63c85f 100644 --- a/cmd/todo.go +++ b/cmd/todo.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/triage.go b/cmd/triage.go index 4796862..4d8628c 100644 --- a/cmd/triage.go +++ b/cmd/triage.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "os" "github.com/spf13/cobra" diff --git a/cmd/wti.go b/cmd/wti.go index fd8fcea..6993323 100644 --- a/cmd/wti.go +++ b/cmd/wti.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "github.com/StevenACoffman/jira-tool/pkg/atlassian" + "github.com/StevenACoffman/jt/pkg/atlassian" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 69880b2..d4eb1bc 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/StevenACoffman/jira-tool +module github.com/StevenACoffman/jt go 1.15 diff --git a/magefile.go b/magefile.go index 91b9eb1..dfbecd8 100644 --- a/magefile.go +++ b/magefile.go @@ -42,7 +42,7 @@ func Install() error { // Clean up after yourself func Clean() { fmt.Println("Cleaning...") - os.RemoveAll("jt") + os.RemoveAll(appName) } var releaseTag = regexp.MustCompile(`^v[0-9]+\.[0-9]+\.[0-9]+$`) @@ -66,7 +66,7 @@ func Release(tag string) (err error) { sh.RunV("git", "push", "--delete", "origin", "$TAG") } }() - return sh.RunV("goreleaser") + return sh.RunV("goreleaser", "--rm-dist") } diff --git a/main.go b/main.go index f41f417..0d7201d 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "github.com/StevenACoffman/jira-tool/cmd" +import "github.com/StevenACoffman/jt/cmd" func main() { cmd.Execute() diff --git a/pkg/atlassian/config.go b/pkg/atlassian/config.go index 6a3abb3..da5cffc 100644 --- a/pkg/atlassian/config.go +++ b/pkg/atlassian/config.go @@ -12,9 +12,9 @@ import ( // Config struct type Config struct { - Host string `json:"host",mapstructure:"host"` - User string `json:"user",mapstructure:"user"` - Token string `json:"token",mapstructure:"token"` + Host string `json:"host" mapstructure:"host"` + User string `json:"user" mapstructure:"user"` + Token string `json:"token" mapstructure:"token"` } // ReadConfigFromFile returns an error if file does not exist diff --git a/pkg/atlassian/jira.go b/pkg/atlassian/jira.go index f9a7964..c2bddd8 100644 --- a/pkg/atlassian/jira.go +++ b/pkg/atlassian/jira.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/StevenACoffman/jira-tool/pkg/middleware" + "github.com/StevenACoffman/jt/pkg/middleware" "github.com/andygrunwald/go-jira" )