chore(justfile): update debug command
This commit is contained in:
@@ -6,6 +6,7 @@ require (
|
||||
github.com/charmbracelet/lipgloss v1.1.0
|
||||
github.com/creack/pty v1.1.24
|
||||
github.com/spf13/cobra v1.10.2
|
||||
github.com/versenilvis/fuzzy v0.1.0-rc
|
||||
golang.org/x/sys v0.42.0
|
||||
golang.org/x/term v0.41.0
|
||||
)
|
||||
@@ -26,7 +27,6 @@ require (
|
||||
github.com/muesli/termenv v0.16.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/versenilvis/fuzzy v0.1.0-rc // indirect
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||
)
|
||||
|
||||
|
||||
@@ -47,4 +47,31 @@ analyze:
|
||||
# run linter
|
||||
[group('dev')]
|
||||
lint:
|
||||
@golangci-lint run ./...
|
||||
@golangci-lint run ./...
|
||||
|
||||
# test the update command (version check + comparison), no full iris session needed
|
||||
# usage: just debug-update v1.99.0
|
||||
[group('debug')]
|
||||
debug-update version="v1.99.0":
|
||||
#!/bin/sh
|
||||
tmp=$(mktemp -d)
|
||||
printf '{"tag_name":"%s"}' "{{version}}" > "$tmp/response.json"
|
||||
python3 -m http.server 19999 --directory "$tmp" 2>/dev/null &
|
||||
SERVER_PID=$!
|
||||
sleep 0.3
|
||||
echo "--- testing iris update command ---"
|
||||
IRIS_UPDATE_URL="http://localhost:19999/response.json" ./iris update
|
||||
kill $SERVER_PID 2>/dev/null
|
||||
rm -rf "$tmp"
|
||||
|
||||
# test the in-session update notification banner (requires iris.zsh hook to be active)
|
||||
# usage: just debug-notify v1.99.0
|
||||
[group('debug')]
|
||||
debug-notify version="v1.99.0":
|
||||
IRIS_PID="" IRIS_MOCK_LATEST_VERSION="{{version}}" ./iris
|
||||
|
||||
# build a versioned release binary
|
||||
# usage: just build-release v1.2.0
|
||||
[group('debug')]
|
||||
build-release version:
|
||||
@GOAMD64=v3 go build -pgo=auto -ldflags="-s -w -X github.com/versenilvis/iris/root.Version={{version}}" -trimpath -o iris main.go
|
||||
|
||||
Reference in New Issue
Block a user