diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-16 03:23:47 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-16 03:23:47 -0500 |
| commit | 3b917a87e12c8ef97bc52afd3903ac22c082f7b1 (patch) | |
| tree | 5f0f0a05a77b4a721e43066778070edd0f633f02 | |
| parent | 4106020d713ea1d8ed815b1180d8df3ea60ae46e (diff) | |
Fix repl.sh and typecheck.sh to properly parse bild --plan JSON
The issue was that bild --plan outputs progress indicators before the
JSON, causing jq to fail parsing. Fixed by: - Using grep to extract
only lines starting with '{' (the JSON output) - This filters out
progress lines like '[…] target' - Restored typecheck.sh to use
repl.sh for proper environment setup
Now typecheck.sh correctly provisions the environment via repl.sh
instead of trying to use bild or raw python.
| -rw-r--r-- | .tasks/tasks.jsonl | 4 | ||||
| -rwxr-xr-x | Omni/Ide/repl.sh | 3 | ||||
| -rwxr-xr-x | Omni/Ide/typecheck.sh | 28 |
3 files changed, 27 insertions, 8 deletions
diff --git a/.tasks/tasks.jsonl b/.tasks/tasks.jsonl index 4b29535..f86f9ab 100644 --- a/.tasks/tasks.jsonl +++ b/.tasks/tasks.jsonl @@ -97,8 +97,8 @@ {"taskCreatedAt":"2025-11-16T04:07:08.906237761Z","taskDependencies":[],"taskId":"t-gbyzV2","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Done","taskTitle":"Update home page to show public feed when user is logged out","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:16:44.848713835Z"} {"taskCreatedAt":"2025-11-16T04:07:09.433392796Z","taskDependencies":[],"taskId":"t-gbAN3x","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Done","taskTitle":"Add admin toggle button to episode cards for public/private status","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T08:13:58.676381973Z"} {"taskCreatedAt":"2025-11-16T04:07:17.092115521Z","taskDependencies":[],"taskId":"t-gc6Vrk","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Done","taskTitle":"Add POST /admin/episode/{id}/toggle-public endpoint","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T08:13:58.727479053Z"} -{"taskCreatedAt":"2025-11-16T04:07:17.6266109Z","taskDependencies":[],"taskId":"t-gc9aud","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Open","taskTitle":"Add '+ Add to your feed' button on episode pages for logged-in users","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:07:17.6266109Z"} -{"taskCreatedAt":"2025-11-16T04:07:18.165342861Z","taskDependencies":[],"taskId":"t-gcbqDl","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Open","taskTitle":"Add POST /episode/{id}/add-to-feed endpoint","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:07:18.165342861Z"} +{"taskCreatedAt":"2025-11-16T04:07:17.6266109Z","taskDependencies":[],"taskId":"t-gc9aud","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Done","taskTitle":"Add '+ Add to your feed' button on episode pages for logged-in users","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T08:22:35.253656788Z"} +{"taskCreatedAt":"2025-11-16T04:07:18.165342861Z","taskDependencies":[],"taskId":"t-gcbqDl","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Done","taskTitle":"Add POST /episode/{id}/add-to-feed endpoint","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T08:22:35.305050805Z"} {"taskCreatedAt":"2025-11-16T04:07:18.700573408Z","taskDependencies":[],"taskId":"t-gcdFSb","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Open","taskTitle":"Add POST /episode/{id}/track endpoint for metrics tracking","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:07:18.700573408Z"} {"taskCreatedAt":"2025-11-16T04:07:19.229153372Z","taskDependencies":[],"taskId":"t-gcfTnG","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Open","taskTitle":"Add JavaScript to episode player for tracking play events","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:07:19.229153372Z"} {"taskCreatedAt":"2025-11-16T04:07:27.174644219Z","taskDependencies":[],"taskId":"t-gcNemK","taskNamespace":"Biz/PodcastItLater.hs","taskParent":"t-ga8V8O","taskStatus":"Open","taskTitle":"Enhance Worker.py to extract publication date and author metadata from articles","taskType":"WorkTask","taskUpdatedAt":"2025-11-16T04:07:27.174644219Z"} diff --git a/Omni/Ide/repl.sh b/Omni/Ide/repl.sh index d4ff200..ad6bc02 100755 --- a/Omni/Ide/repl.sh +++ b/Omni/Ide/repl.sh @@ -30,7 +30,8 @@ fi shift fi targets="${*:?}" - json=$(bild --plan "${targets[@]}") + # Extract only the JSON line from bild --plan output (skip progress indicators) + json=$(bild --plan "${targets[@]}" 2>&1 | grep -E '^\{') mapfile -t langdeps < <(jq --raw-output '.[].langdeps | select(length > 0) | join("\n")' <<< "$json") mapfile -t sysdeps < <(jq --raw-output '.[].sysdeps | select(length > 0) | join("\n")' <<< "$json") mapfile -t rundeps < <(jq --raw-output '.[].rundeps | select(length > 0) | join("\n")' <<< "$json") diff --git a/Omni/Ide/typecheck.sh b/Omni/Ide/typecheck.sh index 5f92c90..0d9648d 100755 --- a/Omni/Ide/typecheck.sh +++ b/Omni/Ide/typecheck.sh @@ -4,8 +4,8 @@ ### ### > typecheck.sh <target..> ### -### Runs the typechecker for the given target by building it with bild. -### This leverages bild's built-in typechecking without running tests. +### Uses repl.sh to provision the environment for target, then runs the +### appropriate typechecker for the given module. ### help() { sed -rn 's/^### ?//;T;p' "$0" @@ -16,6 +16,24 @@ if [[ $# == 0 ]] || [[ "$1" == "-h" ]]; then fi target="$1" -# Use bild to typecheck (bild runs mypy for Python, ghc for Haskell, etc.) -# This is simpler than trying to set up the environment ourselves -bild "$target" +# Determine file extension +ext="${target##*.}" + +case "$ext" in + py) + # Python: use mypy via repl.sh environment + repl.sh --cmd "python -m mypy $target" "$target" + ;; + hs) + # Haskell: use ghc -fno-code + # This would need the right environment from repl.sh + echo "Haskell typechecking not yet implemented in typecheck.sh" + echo "Use 'bild $target' to build and typecheck" + exit 1 + ;; + *) + echo "Unknown file extension: $ext" + echo "Typechecking not supported for this file type" + exit 1 + ;; +esac |
