Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f994cb

Browse files
committed
fixup! feat: add autostart/autostop show, show autostart/autostop schedule in ls output
1 parent 7b3e862 commit 4f994cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cli/autostart.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ func autostartShow() *cobra.Command {
5252
}
5353

5454
if workspace.AutostartSchedule == "" {
55-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "not enabled")
55+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "not enabled\n")
5656
return nil
5757
}
5858

5959
validSchedule, err := schedule.Weekly(workspace.AutostartSchedule)
6060
if err != nil {
6161
// This should never happen.
62-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "invalid autostart schedule %q for workspace %s: %s", workspace.AutostartSchedule, workspace.Name, err.Error())
62+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "invalid autostart schedule %q for workspace %s: %s\n", workspace.AutostartSchedule, workspace.Name, err.Error())
6363
return nil
6464
}
6565

66-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "\nschedule: %s\nnext: %s\n", workspace.AutostartSchedule, validSchedule.Next(time.Now()))
66+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "schedule: %s\nnext: %s\n", workspace.AutostartSchedule, validSchedule.Next(time.Now()))
6767

6868
return nil
6969
},

cli/autostop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ func autostopShow() *cobra.Command {
5252
}
5353

5454
if workspace.AutostopSchedule == "" {
55-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "not enabled")
55+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "not enabled\n")
5656
return nil
5757
}
5858

5959
validSchedule, err := schedule.Weekly(workspace.AutostopSchedule)
6060
if err != nil {
6161
// This should never happen.
62-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "invalid autostop schedule %q for workspace %s: %s", workspace.AutostopSchedule, workspace.Name, err.Error())
62+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "invalid autostop schedule %q for workspace %s: %s\n", workspace.AutostopSchedule, workspace.Name, err.Error())
6363
return nil
6464
}
6565

66-
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "\nschedule: %s\nnext: %s\n", workspace.AutostopSchedule, validSchedule.Next(time.Now()))
66+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "schedule: %s\nnext: %s\n", workspace.AutostopSchedule, validSchedule.Next(time.Now()))
6767

6868
return nil
6969
},

0 commit comments

Comments
 (0)