Skip to content

Commit 0451b1b

Browse files
Merge pull request #167 from digitalghost-dev/1.5.0
1.5.0
2 parents 46d0e4c + 515f163 commit 0451b1b

File tree

22 files changed

+940
-122
lines changed

22 files changed

+940
-122
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
- '.github/**'
1818
- '.dockerignore'
1919
- 'docs/**'
20-
- 'etl/**'
20+
- '../../card_data/**'
2121
- '.gitignore'
2222
- 'demo**'
2323
- 'go.mod'
@@ -28,7 +28,7 @@ on:
2828
- main
2929

3030
env:
31-
VERSION_NUMBER: 'v1.4.0'
31+
VERSION_NUMBER: 'v1.5.0'
3232
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3333
AWS_REGION: 'us-west-2'
3434

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ go.work.sum
2828
.env
2929

3030
# Python
31-
etl/.venv
31+
card_data/.venv
32+
__pycache__/
33+
34+
# Terraform
35+
card_data/terraform/access-token
36+
/card_data/terraform/access-token
37+
card_data/terraform/secrets.tfvars
38+
card_data/terraform/terraform.tfstate
39+
/card_data/terraform/.terraform/

.goreleaser.yml

Lines changed: 22 additions & 3 deletions
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.4.0
17+
- -s -w -X main.version=v1.5.0
1818

1919
archives:
2020
- formats: [ 'zip' ]
@@ -45,12 +45,31 @@ homebrew_casks:
4545
owner: digitalghost-dev
4646
name: homebrew-tap
4747
token: "{{.Env.GITHUB_TOKEN}}"
48-
homepage: "https://github.com/digitalghost-dev/poke-cli"
48+
homepage: "https://docs.poke-cli.com/"
4949
description: "A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!"
5050
license: "Apache License 2.0"
5151
hooks:
5252
post:
5353
install: |
5454
if OS.mac? && system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
5555
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/poke-cli"]
56-
end
56+
end
57+
58+
winget:
59+
- name: poke-cli
60+
publisher: digitalghost-dev
61+
license: MIT
62+
homepage: "https://docs.poke-cli.com/"
63+
short_description: "Pokémon CLI/TUI terminal tool."
64+
repository:
65+
owner: digitalghost-dev
66+
name: winget-pkgs
67+
token: "{{.Env.GITHUB_TOKEN}}"
68+
branch: "poke-cli-{{.Version}}"
69+
pull_request:
70+
enabled: true
71+
base:
72+
owner: microsoft
73+
name: winget-pkgs
74+
branch: master
75+
description: "A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!"

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ RUN go mod download
88

99
COPY . .
1010

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

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

16-
# Install only necessary packages and remove them after use
16+
# Installing only necessary packages and remove them after use
1717
RUN apk upgrade && \
1818
apk add --no-cache shadow && \
1919
addgroup -S poke_group && adduser -S poke_user -G poke_group && \
@@ -25,10 +25,8 @@ COPY --from=build /app/poke-cli /app/poke-cli
2525
ENV TERM=xterm-256color
2626
ENV COLOR_OUTPUT=true
2727

28-
# Set correct permissions
2928
RUN chown -R poke_user:poke_group /app
3029

31-
# Switch to non-root user
3230
USER poke_user
3331

3432
ENTRYPOINT ["/app/poke-cli"]

README.md

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img height="250" width="350" src="pokemon.svg" alt="pokemon-logo"/>
33
<h1>Pokémon CLI</h1>
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.4.0?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.5.0?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">
@@ -24,14 +24,15 @@ View future plans in the [Roadmap](#roadmap) section.
2424

2525
---
2626
## Demo
27-
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.3.3.gif)
27+
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.5.0.gif)
2828

2929
---
3030
## Installation
3131

3232
* [Binary](#binary)
3333
* [Docker Image](#docker-image)
3434
* [Homebrew](#homebrew)
35+
* [Winget](#winget)
3536
* [Source](#source)
3637

3738
### Binary
@@ -77,11 +78,11 @@ View future plans in the [Roadmap](#roadmap) section.
7778
3. Choose how to interact with the container:
7879
* Run a single command and exit:
7980
```bash
80-
docker run --rm -it digitalghostdev/poke-cli:v1.4.0 <command> [subcommand] flag]
81+
docker run --rm -it digitalghostdev/poke-cli:v1.5.0 <command> [subcommand] flag]
8182
```
8283
* Enter the container and use its shell:
8384
```bash
84-
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.4.0 -c "cd /app && exec sh"
85+
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.5.0 -c "cd /app && exec sh"
8586
# placed into the /app directory, run the program with './poke-cli'
8687
# example: ./poke-cli ability swift-swim
8788
```
@@ -91,7 +92,18 @@ View future plans in the [Roadmap](#roadmap) section.
9192
```bash
9293
brew install --cask digitalghost-dev/tap/poke-cli
9394
````
94-
2. Verify install!
95+
2. Verify install:
96+
```bash
97+
poke-cli -v
98+
```
99+
100+
### Winget
101+
1. Install the package:
102+
```powershell
103+
winget install poke-cli
104+
```
105+
106+
2. Verify install:
95107
```bash
96108
poke-cli -v
97109
```
@@ -108,35 +120,36 @@ View future plans in the [Roadmap](#roadmap) section.
108120
## Usage
109121
By running `poke-cli [-h | --help]`, it'll display information on how to use the tool.
110122
```
111-
╭──────────────────────────────────────────────────────────╮
112-
│Welcome! This tool displays data related to Pokémon! │
113-
│ │
114-
│ USAGE: │
115-
│ poke-cli [flag] │
116-
│ poke-cli <command> [flag] │
117-
│ poke-cli <command> <subcommand> [flag] │
118-
│ │
119-
│ FLAGS: │
120-
│ -h, --help Shows the help menu │
121-
│ -l, --latest Prints the latest version available │
122-
│ -v, --version Prints the current version │
123-
│ │
124-
│ COMMANDS: │
125-
│ ability Get details about an ability │
126-
│ item Get details about an item │
127-
│ move Get details about a move │
128-
│ natures Get details about all natures │
129-
│ pokemon Get details about a Pokémon │
130-
│ search Search for a resource │
131-
│ types Get details about a typing │
132-
│ │
133-
│ hint: when calling a resource with a space, use a hyphen │
134-
│ example: poke-cli ability strong-jaw │
135-
│ example: poke-cli pokemon flutter-mane │
136-
│ │
137-
│ ↓ ctrl/cmd + click for docs/guides │
138-
│ docs.poke-cli.com │
139-
╰──────────────────────────────────────────────────────────╯
123+
╭───────────────────────────────────────────────────────────────╮
124+
│Welcome! This tool displays data related to Pokémon! │
125+
│ │
126+
│ USAGE: │
127+
│ poke-cli [flag] │
128+
│ poke-cli <command> [flag] │
129+
│ poke-cli <command> <subcommand> [flag] │
130+
│ │
131+
│ FLAGS: │
132+
│ -h, --help Shows the help menu │
133+
│ -l, --latest Prints the latest version available │
134+
│ -v, --version Prints the current version │
135+
│ │
136+
│ COMMANDS: │
137+
│ ability Get details about an ability │
138+
│ item Get details about an item │
139+
│ move Get details about a move │
140+
│ natures Get details about all natures │
141+
│ pokemon Get details about a Pokémon │
142+
│ search Search for a resource │
143+
│ speed Calculate the speed of a Pokémon in battle │
144+
│ types Get details about a typing │
145+
│ │
146+
│ hint: when calling a resource with a space, use a hyphen │
147+
│ example: poke-cli ability strong-jaw │
148+
│ example: poke-cli pokemon flutter-mane │
149+
│ │
150+
│ ↓ ctrl/cmd + click for docs/guides │
151+
│ docs.poke-cli.com │
152+
╰───────────────────────────────────────────────────────────────╯
140153
```
141154
142155
---
@@ -163,7 +176,7 @@ Below is a list of the planned/completed commands and flags:
163176
- [ ] `item`
164177
- [x] `move`
165178
- [x] `pokemon`
166-
- [ ] `speed`: compare speed stats between two Pokémon.
179+
- [x] `speed`: compare speed stats between two Pokémon.
167180
- [x] `types`: get data about a specific typing.
168181

169182
---

cli.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/digitalghost-dev/poke-cli/cmd/natures"
1010
"github.com/digitalghost-dev/poke-cli/cmd/pokemon"
1111
"github.com/digitalghost-dev/poke-cli/cmd/search"
12+
"github.com/digitalghost-dev/poke-cli/cmd/speed"
1213
"github.com/digitalghost-dev/poke-cli/cmd/types"
1314
"github.com/digitalghost-dev/poke-cli/cmd/utils"
1415
"github.com/digitalghost-dev/poke-cli/flags"
@@ -72,6 +73,7 @@ func runCLI(args []string) int {
7273
fmt.Sprintf("\n\t%-15s %s", "natures", "Get details about all natures"),
7374
fmt.Sprintf("\n\t%-15s %s", "pokemon", "Get details about a Pokémon"),
7475
fmt.Sprintf("\n\t%-15s %s", "search", "Search for a resource"),
76+
fmt.Sprintf("\n\t%-15s %s", "speed", "Calculate the speed of a Pokémon in battle"),
7577
fmt.Sprintf("\n\t%-15s %s", "types", "Get details about a typing"),
7678
"\n\n", styling.StyleItalic.Render("hint: when calling a resource with a space, use a hyphen"),
7779
"\n", styling.StyleItalic.Render("example: poke-cli ability strong-jaw"),
@@ -105,6 +107,7 @@ func runCLI(args []string) int {
105107
"move": utils.HandleCommandOutput(move.MoveCommand),
106108
"natures": utils.HandleCommandOutput(natures.NaturesCommand),
107109
"pokemon": utils.HandleCommandOutput(pokemon.PokemonCommand),
110+
"speed": utils.HandleCommandOutput(speed.SpeedCommand),
108111
"types": utils.HandleCommandOutput(types.TypesCommand),
109112
"search": func() int {
110113
search.SearchCommand()
@@ -141,6 +144,7 @@ func runCLI(args []string) int {
141144
fmt.Sprintf("\n\t%-15s %s", "natures", "Get details about all natures"),
142145
fmt.Sprintf("\n\t%-15s %s", "pokemon", "Get details about a Pokémon"),
143146
fmt.Sprintf("\n\t%-15s %s", "search", "Search for a resource"),
147+
fmt.Sprintf("\n\t%-15s %s", "speed", "Calculate the speed of a Pokémon in battle"),
144148
fmt.Sprintf("\n\t%-15s %s", "types", "Get details about a typing"),
145149
fmt.Sprintf("\n\nAlso run %s for more info!", styling.StyleBold.Render("poke-cli -h")),
146150
)

cli_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ func TestRunCLI(t *testing.T) {
101101
expectedOutput: utils.LoadGolden(t, "cli_help.golden"),
102102
expectedCode: 0,
103103
},
104+
{
105+
name: "Non-valid command",
106+
args: []string{"movesets"},
107+
expectedOutput: utils.LoadGolden(t, "cli_incorrect_command.golden"),
108+
expectedCode: 1,
109+
},
104110
}
105111

106112
for _, tt := range tests {

0 commit comments

Comments
 (0)