Skip to content

Commit 7ed85e6

Browse files
Merge pull request #246 from digitalghost-dev/1.8.10
1.8.10
2 parents e14d9ef + b1adc7d commit 7ed85e6

25 files changed

Lines changed: 126 additions & 188 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
- main
3232

3333
env:
34-
VERSION_NUMBER: 'v1.8.9'
34+
VERSION_NUMBER: 'v1.8.10'
3535
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3636
AWS_REGION: 'us-west-2'
3737

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ builds:
1414
- windows
1515
- darwin
1616
ldflags:
17-
- -s -w -X main.version=v1.8.9
17+
- -s -w -X main.version=v1.8.10
1818

1919
archives:
2020
- formats: [ 'zip' ]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN go mod download
88

99
COPY . .
1010

11-
RUN go build -ldflags "-X main.version=v1.8.9" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v1.8.10" -o poke-cli .
1212

1313
# build 2
1414
FROM --platform=$BUILDPLATFORM alpine:3.23

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
33
<h4></h4>
44
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
5-
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.8.9?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
5+
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.8.10?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
66
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
77
</div>
88
<div align="center">
@@ -99,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
9999
3. Choose how to interact with the container:
100100
* Run a single command and exit:
101101
```bash
102-
docker run --rm -it digitalghostdev/poke-cli:v1.8.9 <command> [subcommand] [flag]
102+
docker run --rm -it digitalghostdev/poke-cli:v1.8.10 <command> [subcommand] [flag]
103103
```
104104
* Enter the container and use its shell:
105105
```bash
106-
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.9 -c "cd /app && exec sh"
106+
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.10 -c "cd /app && exec sh"
107107
# placed into the /app directory, run the program with './poke-cli'
108108
# example: ./poke-cli ability swift-swim
109109
```
@@ -118,7 +118,7 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
118118
6. Run the tool!
119119

120120
> [!IMPORTANT]
121-
> For macOS, you may have to allow the executable to run as it is not signed. Head to System Settings > Privacy & Security > scroll down and allow executable to run.
121+
> For macOS, you may have to allow the executable to run as it is not signed. Head to System Settings > Privacy & Security > scroll down and allow the executable to run.
122122

123123
<details>
124124

card_data/pipelines/poke_cli_dbt/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'poke_cli_dbt'
2-
version: '1.8.9'
2+
version: '1.8.10'
33

44
profile: 'poke_cli_dbt'
55

card_data/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "card-data"
3-
version = "1.5.2"
3+
version = "1.8.10"
44
description = "File directory to store all data related processes for the Pokémon TCG."
55
readme = "README.md"
66
requires-python = ">=3.12"

cmd/ability/ability.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ func AbilityCommand() (string, error) {
3737
return output.String(), nil
3838
}
3939

40-
flag.Parse()
41-
42-
if err := utils.ValidateAbilityArgs(args); err != nil {
40+
if err := utils.ValidateArgs(args, utils.Validator{MaxArgs: 4, CmdName: "ability", RequireName: true, HasFlags: true}); err != nil {
4341
output.WriteString(err.Error())
4442
return output.String(), err
4543
}

cmd/berry/berry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func BerryCommand() (string, error) {
3737
flag.Parse()
3838

3939
// Validate arguments
40-
if err := utils.ValidateBerryArgs(os.Args); err != nil {
40+
if err := utils.ValidateArgs(os.Args, utils.Validator{MaxArgs: 3, CmdName: "berry", RequireName: false, HasFlags: false}); err != nil {
4141
output.WriteString(err.Error())
4242
return output.String(), err
4343
}

cmd/card/card.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func CardCommand() (string, error) {
3333
flag.Parse()
3434

3535
// Validate arguments
36-
if err := utils.ValidateCardArgs(os.Args); err != nil {
36+
if err := utils.ValidateArgs(os.Args, utils.Validator{MaxArgs: 3, CmdName: "card", RequireName: false, HasFlags: false}); err != nil {
3737
output.WriteString(err.Error())
3838
return output.String(), err
3939
}

cmd/card/cardlist.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var getCardData = connections.CallTCGData
1919
type CardsModel struct {
2020
AllRows []table.Row
2121
Choice string
22+
Error error
2223
IllustratorMap map[string]string
2324
ImageMap map[string]string
2425
Loading bool
@@ -62,7 +63,7 @@ func cardTableStyles(selectedBg lipgloss.Color) table.Styles {
6263
return s
6364
}
6465

65-
func (m *CardsModel) syncTableStylesForFocus() {
66+
func syncTableStylesForFocus(m *CardsModel) {
6667
if m.Search.Focused() {
6768
m.TableStyles = cardTableStyles(inactiveTableSelectedBg)
6869
} else {
@@ -146,7 +147,7 @@ func (m CardsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
146147
if m.Search.Focused() {
147148
m.Search.Blur()
148149
m.Table.Focus()
149-
m.syncTableStylesForFocus()
150+
syncTableStylesForFocus(&m)
150151
return m, nil
151152
}
152153
m.Quitting = true
@@ -168,15 +169,16 @@ func (m CardsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
168169
m.Table.Blur()
169170
m.Search.Focus()
170171
}
171-
m.syncTableStylesForFocus()
172+
syncTableStylesForFocus(&m)
172173
return m, nil
173174
}
174175

175176
case cardDataMsg:
176177
// Data arrived - stop loading and build the table
177178
if msg.err != nil {
178-
m.Quitting = true
179-
return m, tea.Quit
179+
m.Error = msg.err
180+
m.Loading = false
181+
return m, nil
180182
}
181183

182184
ti := textinput.New()
@@ -219,7 +221,7 @@ func (m CardsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
219221
prev := m.Search.Value()
220222
m.Search, bubbleCmd = m.Search.Update(msg)
221223
if m.Search.Value() != prev {
222-
m.applyFilter()
224+
applyFilter(&m)
223225
}
224226
} else {
225227
m.Table, bubbleCmd = m.Table.Update(msg)
@@ -237,7 +239,7 @@ func (m CardsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
237239
return m, bubbleCmd
238240
}
239241

240-
func (m *CardsModel) applyFilter() {
242+
func applyFilter(m *CardsModel) {
241243
q := strings.TrimSpace(strings.ToLower(m.Search.Value()))
242244
if q == "" {
243245
m.Table.SetRows(m.AllRows)
@@ -263,6 +265,13 @@ func (m CardsModel) View() string {
263265
if m.Quitting {
264266
return "\n Quitting card search...\n\n"
265267
}
268+
if m.Error != nil {
269+
return styling.ApiErrorStyle.Render(
270+
"Error loading cards from Supabase:\n" +
271+
m.Error.Error() + "\n\n" +
272+
"Press ctrl+c or esc to exit.",
273+
)
274+
}
266275
if m.Loading {
267276
return lipgloss.NewStyle().Padding(2).Render(
268277
m.Spinner.View() + " Loading cards...",

0 commit comments

Comments
 (0)