import_pr_patch.sh 234 B

1234567
  1. #!/bin/bash
  2. for PR in "$@"; do
  3. gh pr diff "$PR" --patch \
  4. | node -e 'const blob = require("fs").readFileSync("/dev/stdin", "utf-8"); console.log(blob.replace(/From [\s\S]+?\d+ files? changed,.+/g, ""))' \
  5. > "pr_$PR.patch"
  6. done