Skip to content

Commit

Permalink
chore(cli): print warning when adding electron (#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored Jul 20, 2020
1 parent 67e59f6 commit f7767cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export class Config implements CliConfig {
};

platforms: string[] = [];
knownCommunityPlatforms = ['electron'];

constructor(os: string, currentWorkingDir: string, cliBinDir: string) {
this.initOS(os);
Expand Down
10 changes: 10 additions & 0 deletions cli/src/tasks/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ export async function addCommand(config: Config, selectedPlatformName: string) {
log(result);
} else {
logError(`platform ${selectedPlatformName} not found`);

if (config.knownCommunityPlatforms.includes(selectedPlatformName)) {
log(
`Try installing the platform first:\n` +
` ${chalk.bold(
`npm install @capacitor-community/${selectedPlatformName}`,
)}\n` +
`Then, try adding it again.`,
);
}
}
} else {
const platformName = await config.askPlatform(
Expand Down

0 comments on commit f7767cf

Please sign in to comment.