Skip to content

Commit

Permalink
Hightlight site path in yellow if it no longer exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisWiegman committed May 17, 2024
1 parent 4a087ff commit 5867e2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ func list(consoleOutput *console.Console, kanaSite *site.Site) *cobra.Command {
t.SetHeaders("Name", "Path", "Running")

for _, site := range sites {
t.AddRow(site.Name, site.Path, strconv.FormatBool(site.Running))
path := site.Path
_, err := os.Stat(site.Path)
if err != nil && os.IsNotExist(err) {
path = consoleOutput.Yellow(path)
}

t.AddRow(site.Name, path, strconv.FormatBool(site.Running))
}

t.Render()
Expand Down

0 comments on commit 5867e2c

Please sign in to comment.