Skip to content

Commit cbe8454

Browse files
authored
Merge pull request gitgitgadget#1792 from dscho/fix-set-app-token
misc-helper set-app-token: do handle optional arguments again
2 parents 46a29dc + 7cf93dc commit cbe8454

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/misc-helper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,9 @@ const commandOptions = commander.opts<ICommanderOptions>();
391391
});
392392
commander
393393
.command("set-app-token")
394+
.argument("[args...]")
394395
.description("Set the GitHub App token in the Git config")
395-
.action(async () => {
396+
.action(async (...args: string[]) => {
396397
const set = async (options: { appID: number; installationID?: number; name: string }): Promise<void> => {
397398
const appName = options.name === config.app.name ? config.app.name : config.app.altname;
398399
const appNameKey = `${appName}.privateKey`;
@@ -430,7 +431,7 @@ const commandOptions = commander.opts<ICommanderOptions>();
430431
};
431432

432433
await set(config.app);
433-
for (const org of commander.args.slice(1)) {
434+
for (const org of args) {
434435
await set({ appID: 46807, name: org });
435436
}
436437
});

0 commit comments

Comments
 (0)