Skip to content

Commit 494be1c

Browse files
committed
feat: add version flag support and VHS demo recording
- Add version variable to Makefile using git describe - Update build to include version info via LDFLAGS - Add VHS demo recording script (vhs/basic.tape) - Update README with demo GIF and VHS instructions - Ignore generated GIF files in .gitignore
1 parent 4a2d34c commit 494be1c

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ go.work
2828
# OS
2929
.DS_Store
3030
Thumbs.db
31+
32+
# Assets
33+
vhs/*.gif

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
.PHONY: default build test format lint install-deps clean run snapshot release-local ci-local
22

3+
VERSION := $(shell git describe --tags --always)
4+
LDFLAGS := -X 'main.version=$(VERSION)'
5+
36
# Default task
47
default: format lint build
58

69
# Build the application
710
build: clean test
8-
go build -o countdown .
11+
go build -ldflags "$(LDFLAGS)" -o countdown .
912

1013
# Run tests
1114
test: clean

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A terminal countdown timer with animated spinners.
44

5+
![Screen recording of liftoff](https://vhs.charm.sh/vhs-22kW7Is8pCwf5CXnk3oMLE.gif)
6+
57
```
68
🌙 Liftoff in 99
79
```
@@ -181,13 +183,11 @@ The workflow builds binaries for all platforms and creates a GitHub release.
181183

182184
Optionally fetch changes with `jj` to see the new tag on `main`.
183185

184-
### Homebrew Tap Setup
185-
186-
To enable `brew install`:
186+
### Record demo video with VHS
187187

188-
1. Create a repository named `homebrew-tap`
189-
1. Add `HOMEBREW_TAP_TOKEN` secret to this repo (token with write access to tap repo)
190-
1. GoReleaser updates the formula automatically on release
188+
```nushell
189+
docker run --rm -v ($env.PWD):/vhs ghcr.io/charmbracelet/vhs vhs/basic.tape
190+
```
191191

192192
## License
193193

vhs/basic.tape

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Configuration
2+
3+
Output vhs/basic.gif
4+
5+
Require countdown
6+
7+
Set Shell "bash"
8+
Set FontSize 32
9+
Set Width 1200
10+
Set Height 300
11+
12+
Env PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/vhs"
13+
14+
# Script for recording
15+
16+
# Type './countdown --spinner "bomb" --range "10..0" --title "Implosion in"' Sleep 1s
17+
Type './countdown --spinner "bomb" --range "10..0" \'
18+
Enter
19+
Type ' --title "Implosion in"' Sleep 1s
20+
Enter Sleep 14s

0 commit comments

Comments
 (0)