Skip to content

Commit c0b03e2

Browse files
committed
cosmetic changes
1 parent ed24d73 commit c0b03e2

10 files changed

+22
-51
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
# Output of the go coverage tool, specifically when used with LiteIDE
2121
*.out
2222

23-
2423
# End of https://www.gitignore.io/api/go

Gopkg.toml

-27
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
# Gopkg.toml example
2-
#
3-
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
4-
# for detailed Gopkg.toml documentation.
5-
#
6-
# required = ["github.com/user/thing/cmd/thing"]
7-
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8-
#
9-
# [[constraint]]
10-
# name = "github.com/user/project"
11-
# version = "1.0.0"
12-
#
13-
# [[constraint]]
14-
# name = "github.com/user/project2"
15-
# branch = "dev"
16-
# source = "github.com/myfork/project2"
17-
#
18-
# [[override]]
19-
# name = "github.com/x/y"
20-
# version = "2.4.0"
21-
#
22-
# [prune]
23-
# non-go = false
24-
# go-tests = true
25-
# unused-packages = true
26-
27-
281
[[constraint]]
292
name = "github.com/Songmu/prompter"
303
version = "0.1.0"

LICENSE

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
The MIT License (MIT)
2-
31
Copyright (c) 2019 Yasuaki Uechi <[email protected]>
42

53
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -9,13 +7,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97
copies of the Software, and to permit persons to whom the Software is
108
furnished to do so, subject to the following conditions:
119

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
OR OTHER DEALINGS IN THE SOFTWARE.

command_fetch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
"github.com/codegangsta/cli"
7-
"github.com/daviddengcn/go-colortext"
7+
ct "github.com/daviddengcn/go-colortext"
88
)
99

1010
var flagsOfFetch = []cli.Flag{

command_list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77

88
"github.com/codegangsta/cli"
9-
"github.com/daviddengcn/go-colortext"
9+
ct "github.com/daviddengcn/go-colortext"
1010
"github.com/dustin/go-humanize"
1111
)
1212

command_timeline.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"time"
66

77
"github.com/codegangsta/cli"
8-
"github.com/daviddengcn/go-colortext"
8+
ct "github.com/daviddengcn/go-colortext"
99
"github.com/dustin/go-humanize"
1010
)
1111

command_update.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strings"
66

77
"github.com/codegangsta/cli"
8-
"github.com/daviddengcn/go-colortext"
8+
ct "github.com/daviddengcn/go-colortext"
99
)
1010

1111
var flagsOfUpdate = []cli.Flag{

git.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type GitConfig struct {
2020
RemoteOriginURL string `gitconfig:"remote.origin.url"`
2121
}
2222

23+
// RepositoryNotFoundError is for when repository not found
2324
type RepositoryNotFoundError struct {
2425
TargetPath string
2526
}
@@ -28,6 +29,7 @@ func (f RepositoryNotFoundError) Error() string {
2829
return "Repository not found or moved: " + f.TargetPath
2930
}
3031

32+
// NoRemoteSpecifiedError is for when no remote specified
3133
type NoRemoteSpecifiedError struct {
3234
TargetPath string
3335
}
@@ -36,6 +38,7 @@ func (f NoRemoteSpecifiedError) Error() string {
3638
return "No remote repository specified: " + f.TargetPath
3739
}
3840

41+
// NoCommitsError is for when no commits found
3942
type NoCommitsError struct {
4043
TargetPath string
4144
}
@@ -86,7 +89,7 @@ func GitStatus(targetPath string) ([]string, error) {
8689
return statuses[:len(statuses)-1], nil
8790
}
8891

89-
// git log --branches --not --remotes
92+
// GitLog is `git log --branches --not --remotes`
9093
func GitLog(targetPath string) ([]string, error) {
9194
if err := os.Chdir(targetPath); err != nil {
9295
return nil, err
@@ -97,9 +100,8 @@ func GitLog(targetPath string) ([]string, error) {
97100
eout := string(out)
98101
if strings.HasPrefix(eout, "does not have any commits yet") {
99102
return nil, &NoCommitsError{targetPath}
100-
} else {
101-
return nil, err
102103
}
104+
return nil, err
103105
}
104106

105107
if len(out) == 0 {
@@ -111,6 +113,7 @@ func GitLog(targetPath string) ([]string, error) {
111113
return statuses, nil
112114
}
113115

116+
// GitRemoteAdd run `git remote add`
114117
func GitRemoteAdd(targetPath string, name string, url string) error {
115118
if err := os.Chdir(targetPath); err != nil {
116119
return err
@@ -124,6 +127,7 @@ func GitRemoteAdd(targetPath string, name string, url string) error {
124127
return nil
125128
}
126129

130+
// GitRemoteSetURL run `git remote set-url`
127131
func GitRemoteSetURL(targetPath string, name string, url string) error {
128132
if err := os.Chdir(targetPath); err != nil {
129133
return err
@@ -183,6 +187,7 @@ func GitFetch(targetPath string) (string, error) {
183187
return string(out), nil
184188
}
185189

190+
// GitRemoteLocation returns Location header of remote
186191
func GitRemoteLocation(targetURL string) (string, error) {
187192
resp, err := http.Head(targetURL)
188193
if err != nil {

scripts/generate-homebrew-formula

-4
This file was deleted.

text.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/daviddengcn/go-colortext"
6+
ct "github.com/daviddengcn/go-colortext"
77
)
88

99
func printWithColor(str string, color ct.Color) {

0 commit comments

Comments
 (0)