From baa6021ee9a5f70b0e6392f1fb8d35a0bc9a615f Mon Sep 17 00:00:00 2001 From: Chris Sidi Date: Mon, 22 Jul 2024 20:10:10 -0400 Subject: [PATCH] fix: used forked repo as default, not upstream Tested with `node ./bin/gh.mjs template-oss-fix --install --filter 'name:json-parse-even-better-errors'` after removing `~/projects/npm/json-parse-even-better-errors` --- lib/gh/workers/_common.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gh/workers/_common.mjs b/lib/gh/workers/_common.mjs index f3b49a9..d418729 100644 --- a/lib/gh/workers/_common.mjs +++ b/lib/gh/workers/_common.mjs @@ -15,6 +15,11 @@ export const clone = ({ argv, item }) => [ status === 1 && output.includes('already exists') && 0, }, ], + // choose the forked repo as the default, for operations like template-oss-fix + // See https://github.com/cli/cli/issues/9261#issuecomment-2193936803 + ['gh', + ['repo', 'set-default', `${item.owner}/${item.name}`], + ], ] export const checkout = ({ argv }) => [