From cec5b953901b52b129ddc2e1cb645a6d1a077402 Mon Sep 17 00:00:00 2001 From: Jon Zeolla Date: Mon, 6 Apr 2026 08:27:44 -0400 Subject: [PATCH 1/2] fix(platform): replace Unix-only precondition checks with cross-platform alternatives Replaces `which`, `test -d`, `command -v`, and `[[ ]]` with portable equivalents so Taskfile preconditions work on Windows (PowerShell). Co-Authored-By: Claude Opus 4.6 (1M context) --- Taskfile.yml | 6 +++--- {{cookiecutter.project_name}}/Taskfile.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 59fa561..8f218be 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -36,7 +36,7 @@ tasks: status: # Don't do any of this if you aren't in a git repository; quote to avoid yaml intrepretering the ! as a node tag # https://yaml.org/spec/1.2.2/#691-node-tags - - '! test -d .git' + - '! git rev-parse --git-dir' cmds: - uv tool install pre-commit # Don't run this in pipelines @@ -128,9 +128,9 @@ tasks: env: GH_TOKEN: sh: | - if [[ -n "${GH_TOKEN:-}" ]]; then + if [ -n "${GH_TOKEN:-}" ]; then echo "${GH_TOKEN}" - elif command -v gh &> /dev/null && gh auth token &> /dev/null; then + elif gh auth token > /dev/null 2>&1; then gh auth token fi cmds: diff --git a/{{cookiecutter.project_name}}/Taskfile.yml b/{{cookiecutter.project_name}}/Taskfile.yml index c218022..e3a64b0 100644 --- a/{{cookiecutter.project_name}}/Taskfile.yml +++ b/{{cookiecutter.project_name}}/Taskfile.yml @@ -34,7 +34,7 @@ tasks: - pyproject.toml - uv.lock preconditions: - - which uv + - uv --version cmds: # Sync dependencies with uv - uv sync --frozen --all-extras @@ -47,7 +47,7 @@ tasks: status: # Don't do any of this if you aren't in a git repository; quote to avoid yaml intrepretering the ! as a node tag # https://yaml.org/spec/1.2.2/#691-node-tags - - '! test -d .git' + - '! git rev-parse --git-dir' cmds: - uv tool install pre-commit # Don't run this in pipelines @@ -205,9 +205,9 @@ tasks: env: GH_TOKEN: sh: | - if [[ -n "${GH_TOKEN:-}" ]]; then + if [ -n "${GH_TOKEN:-}" ]; then echo "${GH_TOKEN}" - elif command -v gh &> /dev/null && gh auth token &> /dev/null; then + elif gh auth token > /dev/null 2>&1; then gh auth token fi cmds: From 5587458996a52d5817ec2dccbdbf10b3cfe1c260 Mon Sep 17 00:00:00 2001 From: Jon Zeolla Date: Mon, 6 Apr 2026 08:30:27 -0400 Subject: [PATCH 2/2] fix(platform): add Windows uv self-update in update task On Windows, use `uv self update` instead of skipping the uv upgrade entirely. macOS/Linux continues to use `brew upgrade uv`. Co-Authored-By: Claude Opus 4.6 (1M context) --- Taskfile.yml | 4 ++-- {{cookiecutter.project_name}}/Taskfile.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 8f218be..2bacc5a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -93,8 +93,8 @@ tasks: update: desc: Update the project dev and runtime dependencies cmds: - # Upgrade uv via brew on macOS/Linux when running locally (not CI) - - '{{if and (ne .GITHUB_ACTIONS "true") (ne OS "windows")}}brew upgrade uv{{end}}' + # Upgrade uv when running locally (not CI); use brew on macOS/Linux, uv self update on Windows + - '{{if ne .GITHUB_ACTIONS "true"}}{{if ne OS "windows"}}brew upgrade uv{{else}}uv self update{{end}}{{end}}' - uv tool upgrade --all - pre-commit autoupdate --freeze --jobs 4 # Copy the newly updated config into the project template, excluding the exclude line diff --git a/{{cookiecutter.project_name}}/Taskfile.yml b/{{cookiecutter.project_name}}/Taskfile.yml index e3a64b0..4e0f0c7 100644 --- a/{{cookiecutter.project_name}}/Taskfile.yml +++ b/{{cookiecutter.project_name}}/Taskfile.yml @@ -173,8 +173,8 @@ tasks: update: desc: Update the project dev and runtime dependencies cmds: - # Upgrade uv via brew on macOS/Linux when running locally (not CI) - - '{{ '{{if and (ne .GITHUB_ACTIONS "true") (ne OS "windows")}}' }}brew upgrade uv{{ '{{end}}' }}' + # Upgrade uv when running locally (not CI); use brew on macOS/Linux, uv self update on Windows + - '{{ '{{if ne .GITHUB_ACTIONS "true"}}{{if ne OS "windows"}}' }}brew upgrade uv{{ '{{else}}' }}uv self update{{ '{{end}}{{end}}' }}' - uv tool upgrade --all - pre-commit autoupdate --freeze --jobs 4 - uv lock --upgrade