豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 23ccc87

Browse files
committed
fix(ng-dev/pr): yargs positional placeholder does not match positional name
In the `CommandModule` below we named the positional `<pr>`, but our option does not reflect this. This causes the PR number to be not passed to the GraphQL GitHub request. This happens due to a recent refactoring that intended to standardize `pr` and `pr-number` to just `pr`.
1 parent ec636aa commit 23ccc87

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ng-dev/pr/checkout/cli.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ import {addGithubTokenOption} from '../../utils/git/github-yargs';
1212
import {checkOutPullRequestLocally} from '../common/checkout-pr';
1313

1414
export interface CheckoutOptions {
15-
prNumber: number;
15+
pr: number;
1616
githubToken: string;
1717
}
1818

1919
/** Builds the checkout pull request command. */
2020
function builder(yargs: Argv) {
21-
return addGithubTokenOption(yargs).positional('prNumber', {type: 'number', demandOption: true});
21+
return addGithubTokenOption(yargs).positional('pr', {type: 'number', demandOption: true});
2222
}
2323

2424
/** Handles the checkout pull request command. */
25-
async function handler({prNumber, githubToken}: Arguments<CheckoutOptions>) {
26-
const prCheckoutOptions = {allowIfMaintainerCannotModify: true, branchName: `pr-${prNumber}`};
27-
await checkOutPullRequestLocally(prNumber, githubToken, prCheckoutOptions);
25+
async function handler({pr, githubToken}: Arguments<CheckoutOptions>) {
26+
const prCheckoutOptions = {allowIfMaintainerCannotModify: true, branchName: `pr-${pr}`};
27+
await checkOutPullRequestLocally(pr, githubToken, prCheckoutOptions);
2828
}
2929

3030
/** yargs command module for checking out a PR */

0 commit comments

Comments
 (0)