diff options
| author | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-01 15:54:58 -0500 |
|---|---|---|
| committer | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-01 15:54:58 -0500 |
| commit | db1c2b8ce214bc555b8aa21114c6614e9071bf34 (patch) | |
| tree | f01d5c945d90472226d280be205d9cfc4a64faad /bin | |
| parent | 1e72f44f28b97ef3f28627421bedca379d136a76 (diff) | |
Add simple shell executable
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/cheat | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/cheat b/bin/cheat new file mode 100755 index 0000000..4988312 --- /dev/null +++ b/bin/cheat @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_PATH="$(readlink -f "$0")" +SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)" +REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" + +if [[ -x "$REPO_DIR/.venv/bin/python" ]]; then + PYTHON_BIN="$REPO_DIR/.venv/bin/python" +elif [[ -x "$REPO_DIR/venv/bin/python" ]]; then + PYTHON_BIN="$REPO_DIR/venv/bin/python" +else + echo "No project virtualenv found at $REPO_DIR/.venv or $REPO_DIR/venv" >&2 + exit 1 +fi + +cd "$REPO_DIR" +exec "$PYTHON_BIN" "$REPO_DIR/query_index.py" "$@" |