Skip to content

Commit

Permalink
chore: move gif command into docsgen
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed May 1, 2024
1 parent caae57d commit 818bbd4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,3 @@ lint:
.PHONY: tidy
tidy:
$(MAKE) --no-print-directory -C misc tidy

gif:
TAPES_DIR=$(PWD)/docs $(MAKE) -C ./misc/gno-vhs gif.docker
3 changes: 3 additions & 0 deletions misc/gendocs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ clean:

kill_zombies:
kill -9 `lsof -t -i tcp:8080 -s TCP:LISTEN` || true

gif:
TAPES_DIR=$(PWD)/../../docs $(MAKE) -C ../gno-vhs gif.docker
18 changes: 10 additions & 8 deletions misc/gno-vhs/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Generate GIFs using VHS

# Current Makefile path
CPATH := $(PWD)
# Makefile directory
CPATH := $(abspath $(lastword $(MAKEFILE_LIST)/../))

# GnoRoot path
GNOROOT_DIR ?= $(abspath $(CPATH)/../../)

# Specify on which directory to run
TAPES_DIR ?= $(GNOROOT_DIR)

# Other overwritable variables
GNOROOT_DIR ?= $(abspath $(lastword $(MAKEFILE_LIST))/../../../)
BUILD_DIR ?= $(CPATH)/.build
IMAGE_NAME ?= charmbracelet/vhs:local

Expand All @@ -19,8 +21,9 @@ gif:
find $(TAPES_DIR) -iname '*.tape' -execdir vhs {} \; -print

## Nix

gif.nix:
nix-shell -p ffmpeg ttyd vhs --run 'make gif'
nix-shell -p ffmpeg ttyd vhs --run 'TAPES_DIR=$(TAPES_DIR) make gif'

## Docker

Expand All @@ -36,6 +39,7 @@ gif.docker: bins .dockerfile.build

## Extra rules to run vhs+gno in Docker
bins: gnodev gno gnokey gnoland
.PHONY: bins

# Build binaries for Linux Docker container
gnodev: | $(BUILD_DIR)
Expand All @@ -46,10 +50,7 @@ gnokey: | $(BUILD_DIR)
GOOS=linux go -C $(GNOROOT_DIR)/gno.land/cmd/gnokey build -v -o $(BUILD_DIR)/gnokey .
gnoland: | $(BUILD_DIR)
GOOS=linux go -C $(GNOROOT_DIR)/gno.land/cmd/gnoland build -v -o $(BUILD_DIR)/gnoland .

# Force rebuild binaries
.PHONY: $(BUILD_DIR)/gnodev $(BUILD_DIR)/gnokey $(BUILD_DIR)/gno $(BUILD_DIR)/gnoland
.PHONY: bins
.PHONY: gnodev gnokey gno gnoland

# Create build directory
$(BUILD_DIR):
Expand All @@ -59,6 +60,7 @@ $(BUILD_DIR):
docker build -t $(IMAGE_NAME) . && touch $@

## Cleanup

clean:
rm -rf $(BUILD_DIR)

Expand Down

0 comments on commit 818bbd4

Please sign in to comment.