Git Tips Slides
PageUp x2: previous · PageDown x2: next · Home: index

Taskfile stamp files per task name

If several independent Taskfile tasks watch the same directory, they should not share a single stamp file. scripts/git-worktree-has-changed.sh therefore requires a task name before the path:

version: "3"

tasks:
  lint:
    status:
      - bash ./scripts/git-worktree-has-changed.sh lint .
    cmds:
      - bash ./internal/lint.sh
      - bash ./scripts/git-worktree-has-changed.sh --touch-stamp lint .

The task name becomes part of the stamp filename in .tmp/. Non filename-safe characters get replaced with underscores.