Skip to content

Commit b8f872f

Browse files
authored
(release): v0.6.0 (#32)
* (chore): update go mod deps * (fix): unblock snapcraft build * (fix): fix workspace env var name * (chore): add badges * (chore): fix golint warnings * (release): v0.6.0
1 parent c38bb80 commit b8f872f

File tree

9 files changed

+199
-62
lines changed

9 files changed

+199
-62
lines changed

.goreleaser.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,14 @@ changelog:
2323
exclude:
2424
- '^docs:'
2525
- '^test:'
26-
# snapcrafts:
27-
# - name: clockify-cli
28-
# summary: Helps to interact with Clockfy's API
29-
# description: Helps to interact with Clockfy's API
26+
snapcrafts:
27+
- name: clockify-cli
28+
summary: Helps to interact with Clockfy's API
29+
description: Helps to interact with Clockfy's API
3030

31-
# grade: stable
32-
# confinement: classic
33-
# publish: true
31+
grade: stable
32+
publish: true
3433

35-
# apps:
36-
# clockify-cli:
37-
# plugs: ["personal-files", "network"]
38-
39-
# plugs:
40-
# personal-files:
41-
# read:
42-
# - $HOME/clockify-cli.yaml
43-
# write:
44-
# - $HOME/clockify-cli.yaml
34+
apps:
35+
clockify-cli:
36+
plugs: ["network"]

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v0.6.0] - 2020-06-16
10+
11+
## Added
12+
13+
- some badges, who does not like they?
14+
15+
## Fixed
16+
17+
- help was showing `CLOCKIFY_WROKSPACE` as env var for workspace, the right name is
18+
`CLOCKIFY_WORKSPACE`
19+
- fixed some `golint` warnings
20+
21+
## Changed
22+
23+
- go mod dependencies updated
24+
- `snapcraft` package only requires network
25+
26+
## Removed
27+
28+
- Removed `GetCurrentUser` in favor of `GetMe` to be closer to the APIs format
29+
930
## [v0.5.0] - 2020-06-15
1031

1132
## Changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ clockify-cli
33

44
A simple cli to manage your time entries on Clockify from terminal
55

6+
[![clockify-cli](https://snapcraft.io//clockify-cli/badge.svg)](https://snapcraft.io/clockify-cli)
7+
[![Build Status](https://travis-ci.org/lucassabreu/clockify-cli.svg?branch=master)](https://travis-ci.org/lucassabreu/clockify-cli)
8+
[![Go Report Card](https://goreportcard.com/badge/github.com/lucassabreu/clockify-cli)](https://goreportcard.com/report/github.com/lucassabreu/clockify-cli)
9+
610
Features
711
--------
812

@@ -63,7 +67,7 @@ Flags:
6367
Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn
6468
--trello-token string Trello's token (defaults to env $CLOCKIFY_TRELLO_TOKEN)
6569
-u, --user-id string user id from the token (defaults to env $CLOCKIFY_USER_ID)
66-
-w, --workspace string workspace to be used (defaults to env $CLOCKIFY_WROKSPACE)
70+
-w, --workspace string workspace to be used (defaults to env $CLOCKIFY_WORKSPACE)
6771
6872
Use "clockify-cli [command] --help" for more information about a command.
6973
```

api/client.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ type WorkspaceUsersParam struct {
9090
Email string
9191
}
9292

93-
func (c *Client) CurrentUser() (dto.User, error) {
94-
var u dto.User
95-
r, err := c.NewRequest("GET", "v1/user", nil)
96-
if err != nil {
97-
return u, err
98-
}
99-
100-
_, err = c.Do(r, &u)
101-
return u, err
102-
}
103-
10493
// WorkspaceUsers all users in a Workspace
10594
func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error) {
10695
var users []dto.User
@@ -133,6 +122,7 @@ func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error) {
133122
return uCopy, nil
134123
}
135124

125+
// PaginationParam parameters about pagination
136126
type PaginationParam struct {
137127
AllPages bool
138128
Page int
@@ -257,9 +247,10 @@ func (c *Client) LogInProgress(p LogInProgressParam) (*dto.TimeEntryImpl, error)
257247
return timeEntryImpl, err
258248
}
259249

250+
// GetTimeEntryParam params to get a Time Entry
260251
type GetTimeEntryParam struct {
261252
Workspace string
262-
TimeEntryId string
253+
TimeEntryID string
263254
}
264255

265256
// GetTimeEntry will retrieve a Time Entry using its Workspace and ID
@@ -269,7 +260,7 @@ func (c *Client) GetTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntryImpl
269260
fmt.Sprintf(
270261
"v1/workspaces/%s/time-entries/%s",
271262
p.Workspace,
272-
p.TimeEntryId,
263+
p.TimeEntryID,
273264
),
274265
nil,
275266
)
@@ -353,6 +344,7 @@ func (c *Client) GetUser(id string) (*dto.User, error) {
353344
return user, err
354345
}
355346

347+
// GetMe get details about the user who created the token
356348
func (c *Client) GetMe() (dto.User, error) {
357349
r, err := c.NewRequest("GET", "v1/user", nil)
358350

api/httpClient.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/lucassabreu/clockify-cli/api/dto"
1212
)
1313

14+
// QueryAppender an interface to identify if the parameters should be sent through the query or body
1415
type QueryAppender interface {
1516
AppendToQuery(url.URL) url.URL
1617
}

cmd/inClone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func getTimeEntry(id, workspace, userID string, c *api.Client) (dto.TimeEntryImp
9999
if id != "last" {
100100
tei, err := c.GetTimeEntry(api.GetTimeEntryParam{
101101
Workspace: workspace,
102-
TimeEntryId: id,
102+
TimeEntryID: id,
103103
})
104104

105105
if err != nil {

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func init() {
5353
Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn`)
5454
_ = viper.BindPFlag("token", rootCmd.PersistentFlags().Lookup("token"))
5555

56-
rootCmd.PersistentFlags().StringP("workspace", "w", "", "workspace to be used (defaults to env $CLOCKIFY_WROKSPACE)")
56+
rootCmd.PersistentFlags().StringP("workspace", "w", "", "workspace to be used (defaults to env $CLOCKIFY_WORKSPACE)")
5757
_ = viper.BindPFlag("workspace", rootCmd.PersistentFlags().Lookup("workspace"))
5858

5959
rootCmd.PersistentFlags().StringP("user-id", "u", "", "user id from the token (defaults to env $CLOCKIFY_USER_ID)")

go.mod

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
module github.com/lucassabreu/clockify-cli
22

33
require (
4-
github.com/BurntSushi/toml v0.3.1 // indirect
5-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
6-
github.com/kr/pretty v0.1.0 // indirect
7-
github.com/mattn/go-isatty v0.0.4 // indirect
4+
github.com/kr/text v0.2.0 // indirect
5+
github.com/mattn/go-colorable v0.1.4 // indirect
6+
github.com/mattn/go-isatty v0.0.11 // indirect
87
github.com/mattn/go-runewidth v0.0.4 // indirect
98
github.com/mitchellh/go-homedir v1.1.0
9+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
1010
github.com/olekukonko/tablewriter v0.0.1
11-
github.com/spf13/cobra v0.0.3
12-
github.com/spf13/viper v1.3.1
13-
github.com/stretchr/testify v1.3.0 // indirect
14-
golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd
15-
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
11+
github.com/smartystreets/assertions v1.0.0 // indirect
12+
github.com/spf13/cobra v1.0.0
13+
github.com/spf13/pflag v1.0.5 // indirect
14+
github.com/spf13/viper v1.6.1
15+
github.com/stretchr/testify v1.6.1 // indirect
16+
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
17+
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
1618
golang.org/x/text v0.3.2 // indirect
1719
gopkg.in/AlecAivazis/survey.v1 v1.8.2
18-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
19-
gopkg.in/yaml.v2 v2.2.2
20+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
21+
gopkg.in/yaml.v2 v2.3.0
2022
)
2123

2224
go 1.13

0 commit comments

Comments
 (0)