Skip to content

Commit

Permalink
Run CLI from any directory (#305)
Browse files Browse the repository at this point in the history
You have to run the CLI from the repo root such as `./dev/cli`, but it
should be runnable from anywhere.

This fixes it.
  • Loading branch information
mkysel authored Dec 5, 2024
1 parent 112e7f5 commit d1212c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dev/cli
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

set -eu

# Get the directory where the script is located
SCRIPT_DIR=$(dirname "$(realpath "$0")")

# Navigate to the top-level directory
TOP_LEVEL_DIR=$(realpath "$SCRIPT_DIR/..")
cd "$TOP_LEVEL_DIR"

go run -ldflags="-X main.Commit=$(git rev-parse HEAD)" cmd/cli/main.go "$@"

0 comments on commit d1212c2

Please sign in to comment.