repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
f940e39
parent
22637b8
author
Eric Bower
date
2024-04-10 03:42:05 +0000 UTC
chore: cleanup pgs cli
3 files changed,  +13, -29
M imgs/config.go
+1, -1
1@@ -26,7 +26,7 @@ func NewConfigSite() *shared.ConfigSite {
2 		MinioUser:  minioUser,
3 		MinioPass:  minioPass,
4 		Space:      "imgs",
5-		AllowedExt:    []string{".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".ico"},
6+		AllowedExt: []string{".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".ico"},
7 		Logger:     shared.CreateLogger(debug == "1"),
8 	}
9 
M pgs/cli.go
+7, -28
 1@@ -17,20 +17,6 @@ import (
 2 	"github.com/picosh/pico/tui/common"
 3 )
 4 
 5-func styleRows(styles common.Styles) func(row, col int) lipgloss.Style {
 6-	return func(row, col int) lipgloss.Style {
 7-		if row == 0 {
 8-			return styles.CliHeader
 9-		}
10-
11-		even := row%2 == 0
12-		if even {
13-			return styles.CliPadding.Copy().Foreground(lipgloss.Color("245"))
14-		}
15-		return styles.CliPadding.Copy().Foreground(lipgloss.Color("252"))
16-	}
17-}
18-
19 func projectTable(styles common.Styles, projects []*db.Project) *table.Table {
20 	headers := []string{
21 		"Name",
22@@ -58,17 +44,14 @@ func projectTable(styles common.Styles, projects []*db.Project) *table.Table {
23 	}
24 
25 	t := table.New().
26-		Border(lipgloss.NormalBorder()).
27-		BorderStyle(styles.CliBorder).
28 		Headers(headers...).
29-		Rows(data...).
30-		StyleFunc(styleRows(styles))
31+		Rows(data...)
32 	return t
33 }
34 
35 func getHelpText(styles common.Styles, userName string) string {
36-	helpStr := "Commands: [help, stats, ls, rm, link, unlink, prune, retain, depends, acl]\n\n"
37-	helpStr += styles.Note.Render("NOTICE:") + " *must* append with `--write` for the changes to persist.\n\n"
38+	helpStr := "Commands: [help, stats, ls, rm, link, unlink, prune, retain, depends, acl]\n"
39+	helpStr += styles.Note.Render("NOTICE:") + " *must* append with `--write` for the changes to persist.\n"
40 
41 	projectName := "projA"
42 	headers := []string{"Cmd", "Description"}
43@@ -116,11 +99,9 @@ func getHelpText(styles common.Styles, userName string) string {
44 	}
45 
46 	t := table.New().
47-		Border(lipgloss.NormalBorder()).
48-		BorderStyle(styles.CliBorder).
49+		Border(lipgloss.HiddenBorder()).
50 		Headers(headers...).
51-		Rows(data...).
52-		StyleFunc(styleRows(styles))
53+		Rows(data...)
54 
55 	helpStr += t.String()
56 	return helpStr
57@@ -271,11 +252,9 @@ func (c *Cmd) stats(cfgMaxSize uint64) error {
58 	}
59 
60 	t := table.New().
61-		Border(lipgloss.NormalBorder()).
62-		BorderStyle(c.Styles.CliBorder).
63+		Border(lipgloss.HiddenBorder()).
64 		Headers(headers...).
65-		Rows(data).
66-		StyleFunc(styleRows(c.Styles))
67+		Rows(data)
68 	c.output(t.String())
69 
70 	return nil
A projects.txt
+5, -0
1@@ -0,0 +1,5 @@
2+docs
3+test
4+tester
5+ui
6+