Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit ada6034

Browse files
committed
* Redraw the entire dashboard every 3 seconds (to accomodate when changing
term size) * Search Google's JWT files first in current directory, then in XDG_CONFIG_HOME/devdash, then crash :D
1 parent f3a2429 commit ada6034

14 files changed

+100
-214
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ vendor
22
goanalytics-*
33
devdash
44
.devdash*
5-
.goreleaser.yml
6-
goreleaser.sh

.goreleaser.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
before:
3+
hooks:
4+
- go mod download
5+
builds:
6+
- id: main
7+
goos:
8+
- windows
9+
- darwin
10+
- linux
11+
# main: ./cmd/devdash/devdash.go
12+
env:
13+
- CGO_ENABLED=0
14+
archives:
15+
- builds:
16+
- main
17+
replacements:
18+
darwin: Darwin
19+
linux: Linux
20+
windows: Windows
21+
386: x86
22+
amd64: x86_64
23+
format_overrides:
24+
- goos: windows
25+
format: zip
26+
checksum:
27+
name_template: 'checksums.txt'
28+
snapshot:
29+
name_template: "{{ .Tag }}-next"
30+
changelog:
31+
# Keep a manual, simpler changelog for now
32+
skip: true

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Next version
8+
9+
* Automatically redraw the dashboard when size of terminal change.
10+
* Fix errors linked to Google JWT files.
11+
712
## [0.4.2] - 2020-02-25
813

914
### Updated

cmd/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111

1212
"github.com/Phantas0s/devdash/internal"
13+
"github.com/adrg/xdg"
1314
"github.com/mitchellh/go-homedir"
1415
"github.com/spf13/viper"
1516
)
@@ -172,13 +173,13 @@ func mapConfig(cfgFile string) config {
172173
}
173174

174175
if cfgFile == "" {
175-
defaultPath := filepath.Join(home, ".config", "devdash")
176+
defaultPath := filepath.Join(xdg.ConfigHome, "devdash")
176177
cfgFile = defaultConfig(defaultPath, "default.yml")
177178
}
178179

179180
// viper.AddConfigPath(home)
180181
viper.AddConfigPath(".")
181-
viper.AddConfigPath(filepath.Join("$XDG_CONFIG_HOME", "devdash"))
182+
viper.AddConfigPath(filepath.Join(xdg.ConfigHome, "devdash"))
182183
viper.AddConfigPath(filepath.Join(home, ".config", "devdash"))
183184

184185
viper.SetConfigName(removeExt(cfgFile))
@@ -215,7 +216,6 @@ func defaultConfig(path string, filename string) string {
215216
file, _ := os.Create(f)
216217
defer file.Close()
217218

218-
// TODO kind of ugly, but not sure if I can use a template here: it will be runtimeee
219219
if file != nil {
220220
_, err := file.Write([]byte(internal.DefaultTemplate()))
221221
if err != nil {

cmd/devdash.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ func begin(file string, debug bool) {
4545
}
4646
}()
4747

48+
align := time.NewTicker(time.Duration(3) * time.Second)
49+
go func() {
50+
for range align.C {
51+
tui.Align()
52+
tui.Render()
53+
}
54+
}()
55+
4856
tui.Loop()
4957
}
5058

51-
// TODO separate render from parsing projects
59+
// build every services present in the configuration
5260
func build(file string, tui *internal.Tui) {
5361
cfg := mapConfig(file)
5462
for _, p := range cfg.Projects {

cmd/root.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var (
1515

1616
rootCmd = &cobra.Command{
1717
Use: "devdash",
18-
Short: "DevDash is a highly configurable terminal dashboard for developers",
19-
Long: `DevDash is a highly flexible terminal dashboard for developers, which allows you to gather and refresh the data you really need from Google Analytics, Google Search Console, Github, TravisCI, and more.`,
18+
Short: "DevDash is a highly configurable terminal dashboard for developers and creators",
19+
Long: `DevDash is a highly flexible terminal dashboard for developers and creators, which allows you to gather and refresh the data you really need from Google Analytics, Google Search Console, Github, TravisCI, and more.`,
2020
Run: func(cmd *cobra.Command, args []string) {
2121
run()
2222
},

go.mod

+3-42
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,34 @@ go 1.12
44

55
require (
66
cloud.google.com/go v0.47.0 // indirect
7-
cloud.google.com/go/bigquery v1.2.0 // indirect
8-
cloud.google.com/go/storage v1.1.2 // indirect
9-
github.com/OneOfOne/xxhash v1.2.5 // indirect
107
github.com/Phantas0s/termui v0.0.0-20200606131028-e1801ece841d
11-
github.com/Phantas0s/testomatic v0.2.2
12-
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
13-
github.com/coreos/bbolt v1.3.3 // indirect
14-
github.com/coreos/etcd v3.3.17+incompatible // indirect
15-
github.com/coreos/go-semver v0.3.0 // indirect
16-
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
17-
github.com/creack/pty v1.1.9 // indirect
18-
github.com/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b // indirect
19-
github.com/gizak/termui v3.1.0+incompatible // indirect
20-
github.com/gogo/protobuf v1.3.1 // indirect
8+
github.com/adrg/xdg v0.3.1
219
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
2210
github.com/google/go-cmp v0.3.1 // indirect
2311
github.com/google/go-github/v28 v28.1.1
24-
github.com/google/pprof v0.0.0-20191028172815-5e965273ee43 // indirect
25-
github.com/gorilla/websocket v1.4.1 // indirect
26-
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
27-
github.com/grpc-ecosystem/grpc-gateway v1.11.3 // indirect
28-
github.com/hashicorp/golang-lru v0.5.3 // indirect
29-
github.com/jasonlvhit/gocron v0.0.0-20200423141508-ab84337f7963
30-
github.com/json-iterator/go v1.1.8 // indirect
31-
github.com/jstemmer/go-junit-report v0.9.1 // indirect
32-
github.com/julienschmidt/httprouter v1.3.0 // indirect
33-
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
34-
github.com/kr/pty v1.1.8 // indirect
3512
github.com/maruel/panicparse v1.3.0 // indirect
36-
github.com/mattn/go-colorable v0.1.4 // indirect
37-
github.com/mattn/go-isatty v0.0.10 // indirect
3813
github.com/mattn/go-runewidth v0.0.5 // indirect
3914
github.com/mitchellh/go-homedir v1.1.0
4015
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
41-
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
4216
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317 // indirect
4317
github.com/pelletier/go-toml v1.6.0 // indirect
4418
github.com/pkg/errors v0.8.1
45-
github.com/prometheus/client_golang v1.2.1 // indirect
46-
github.com/prometheus/tsdb v0.10.0 // indirect
47-
github.com/rogpeppe/fastuuid v1.2.0 // indirect
48-
github.com/rogpeppe/go-internal v1.5.0 // indirect
4919
github.com/shuheiktgw/go-travis v0.2.4
50-
github.com/spaolacci/murmur3 v1.1.0 // indirect
5120
github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c
5221
github.com/spf13/afero v1.2.2 // indirect
5322
github.com/spf13/cobra v1.0.0
5423
github.com/spf13/jwalterweatherman v1.1.0 // indirect
5524
github.com/spf13/pflag v1.0.5 // indirect
5625
github.com/spf13/viper v1.5.0
57-
github.com/stretchr/objx v0.2.0 // indirect
58-
github.com/ugorji/go v1.1.7 // indirect
59-
go.etcd.io/bbolt v1.3.3 // indirect
6026
go.opencensus.io v0.22.1 // indirect
61-
go.uber.org/zap v1.12.0 // indirect
6227
golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf
63-
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 // indirect
64-
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect
65-
golang.org/x/mobile v0.0.0-20191031020345-0945064e013a // indirect
28+
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
6629
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
6730
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
6831
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c // indirect
69-
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
70-
golang.org/x/tools v0.0.0-20191101200257-8dbcdeb83d3f // indirect
71-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
7232
google.golang.org/api v0.13.0
7333
google.golang.org/appengine v1.6.5 // indirect
34+
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6 // indirect
7435
google.golang.org/grpc v1.24.0 // indirect
7536
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
7637
)

0 commit comments

Comments
 (0)