#!/usr/bin/env bash
# Run a given command in every directory that contains cargo workspace
# Right now it just scans for `Cargo.lock`

set -euo pipefail

git ls-files | grep -E '(^|/)Cargo.lock' | while read -r path ; do
  (
    cd "$(dirname "$path")"
    "$@"
  )
done
