Skip to content

Commit

Permalink
fix: default github username
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 31, 2022
1 parent 99bfc4d commit 565a908
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/generators/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Plugin extends Generator {
const msg = 'Time to build an sf plugin!';

this.log(yosay(`${msg} Version: ${version as string}`));
this.githubUsername = await this.user.github.username();
this.githubUsername = await this.getGitUsername();

this.answers = await this.prompt<PluginAnswers>([
{
Expand Down Expand Up @@ -192,4 +192,12 @@ export default class Plugin extends Generator {
exec(`${path.join(path.resolve(this.env.cwd), 'bin', 'dev')} schema generate`, { cwd: this.env.cwd });
}
}

private async getGitUsername(): Promise<string | null> {
try {
return await this.user.github.username();
} catch {
return null;
}
}
}

0 comments on commit 565a908

Please sign in to comment.