Make dashboard updateable
This commit is contained in:
15
main.go
15
main.go
@@ -33,6 +33,7 @@ func main() {
|
||||
cacheEnabled = flag.Bool("cache", defaults.Cache.Enabled, "enable local read cache fallback")
|
||||
cacheMaxAge = flag.Duration("cache-max-age", defaults.Cache.MaxAge.Duration, "maximum offline cache age (0 disables expiry)")
|
||||
cacheDir = flag.String("cache-dir", defaults.Cache.Directory, "local read cache directory")
|
||||
editorMode = flag.String("editor-mode", defaults.Editing.Mode, "description editor mode: standard or vim")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
@@ -89,6 +90,9 @@ func main() {
|
||||
if visited["cache-dir"] {
|
||||
config.Cache.Directory = *cacheDir
|
||||
}
|
||||
if visited["editor-mode"] {
|
||||
config.Editing.Mode = *editorMode
|
||||
}
|
||||
if err := validateConfig(config); err != nil {
|
||||
exitf("configuration: %v", err)
|
||||
}
|
||||
@@ -134,9 +138,16 @@ func main() {
|
||||
PathScrollInterval: config.Paths.ScrollInterval.Duration,
|
||||
ThreadStatusOrder: config.Threads.StatusOrder,
|
||||
ThreadWithinStatus: config.Threads.WithinStatus,
|
||||
EditorMode: config.Editing.Mode,
|
||||
},
|
||||
)
|
||||
if _, err := tea.NewProgram(app, tea.WithAltScreen()).Run(); err != nil {
|
||||
cursorOutput := newTerminalCursorOutput(os.Stdout)
|
||||
app.cursorOutput = cursorOutput
|
||||
if _, err := tea.NewProgram(
|
||||
app,
|
||||
tea.WithAltScreen(),
|
||||
tea.WithOutput(cursorOutput),
|
||||
).Run(); err != nil {
|
||||
exitf("run TUI: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -159,3 +170,5 @@ func exitf(format string, args ...any) {
|
||||
var _ GitHubService = (*GitHubClient)(nil)
|
||||
var _ GitHubWriteService = (*GitHubClient)(nil)
|
||||
var _ GitHubWriteService = (*CachedGitHubService)(nil)
|
||||
var _ GitHubPullRequestWriteService = (*GitHubClient)(nil)
|
||||
var _ GitHubPullRequestWriteService = (*CachedGitHubService)(nil)
|
||||
|
||||
Reference in New Issue
Block a user