feat: add possibility to track time in timewarrior as well
Some checks failed
Go CI Pipeline / ci (push) Has been cancelled
Some checks failed
Go CI Pipeline / ci (push) Has been cancelled
This commit is contained in:
parent
127018b565
commit
c0a83b5892
4 changed files with 44 additions and 15 deletions
12
app.go
12
app.go
|
|
@ -42,8 +42,8 @@ func (a *App) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a *App) connect() (*SSHConnection, error) { // Rückgabetyp geändert
|
||||
if err := a.timeStore.StartTracking(TagWork); err != nil {
|
||||
func (a *App) connect(withoutTimew bool) (*SSHConnection, error) { // Rückgabetyp geändert
|
||||
if err := a.timeStore.StartTracking(TagWork, withoutTimew); err != nil {
|
||||
slog.Warn(fmt.Sprintf("Failed to start time tracking for '%s': %v", TagWork, err))
|
||||
}
|
||||
|
||||
|
|
@ -189,20 +189,20 @@ func (a *App) makeChoice() {
|
|||
|
||||
switch choice {
|
||||
case "start work":
|
||||
a.connect()
|
||||
a.connect(withoutTimew)
|
||||
case "stop work":
|
||||
if err := a.timeStore.StopTracking(); err != nil {
|
||||
if err := a.timeStore.StopTracking(withoutTimew); err != nil {
|
||||
slog.Error(fmt.Sprintf("Failed to stop time tracking: %v", err))
|
||||
}
|
||||
if err := a.killForwardings(); err != nil {
|
||||
slog.Warn(fmt.Sprintf("Could not kill all forwardings: %v", err))
|
||||
}
|
||||
case "start break":
|
||||
if err := a.timeStore.StartTracking(TagBreak); err != nil {
|
||||
if err := a.timeStore.StartTracking(TagBreak, withoutTimew); err != nil {
|
||||
slog.Error(fmt.Sprintf("Failed to start break tracking: %v", err))
|
||||
}
|
||||
case "stop break":
|
||||
if err := a.timeStore.StartTracking(TagWork); err != nil {
|
||||
if err := a.timeStore.StartTracking(TagWork, withoutTimew); err != nil {
|
||||
slog.Error(fmt.Sprintf("Failed to stop break (start work): %v", err))
|
||||
}
|
||||
case "show day summary":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue