Skip to content

Commit

Permalink
chore(cli): add deprecation notice for electron (#3263)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored Jul 14, 2020
1 parent 618f9cf commit b7d5639
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/src/tasks/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { addElectron } from '../electron/add';
import { addIOS, addIOSChecks } from '../ios/add';
import { editProjectSettingsAndroid } from '../android/common';
import { editProjectSettingsIOS } from '../ios/common';
import { check, checkAppConfig, checkPackage, checkWebDir, hasYarn, log, logError, logFatal, logInfo, resolvePlatform, runCommand, runPlatformHook, runTask, writePrettyJSON } from '../common';
import { check, checkAppConfig, checkPackage, checkWebDir, hasYarn, log, logError, logFatal, logInfo, logWarn, resolvePlatform, runCommand, runPlatformHook, runTask, writePrettyJSON } from '../common';
import { sync } from './sync';

import chalk from 'chalk';
Expand All @@ -29,6 +29,8 @@ export async function addCommand(config: Config, selectedPlatformName: string) {
if (platformName === config.web.name) {
webWarning();
return;
} else if (platformName === config.electron.name) {
electronWarning();
}

const existingPlatformDir = config.platformDirExists(platformName);
Expand Down Expand Up @@ -132,3 +134,8 @@ function webWarning() {
log(`For example, if you have a React or Angular project, the 'web' platform is that project.`);
log(`To add Capacitor functionality to your web app, follow the Web Getting Started Guide: https://capacitorjs.com/docs/web`);
}

function electronWarning() {
logWarn(`The electron platform is deprecated!`);
log(`\nPlease use the Capacitor Community Electron Platform: https://github.com/capacitor-community/electron\n`);
}

0 comments on commit b7d5639

Please sign in to comment.