Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 0e72263

Browse files
committed
Fix(state): state reset --plugins|--platforms was resetting both
fixes ionic-team/ionic-cli#399
1 parent 0d24e15 commit 0e72263

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/state.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,14 @@ State.checkAndSaveConfigXml = function checkAndSaveConfigXml(appDirectory, plugi
799799
State.resetState = function resetState(appDirectory, options) {
800800
var platformPath = path.join(appDirectory, 'platforms');
801801
var pluginPath = path.join(appDirectory, 'plugins');
802-
shelljs.rm('-rf', [platformPath, pluginPath]);
803-
logging.logger.info('Removed platforms and plugins'.blue.bold);
802+
if (options.platforms) {
803+
shelljs.rm('-rf', [platformPath]);
804+
logging.logger.info('Removed platforms'.blue.bold);
805+
}
806+
if (options.plugins) {
807+
shelljs.rm('-rf', [pluginPath]);
808+
logging.logger.info('Removed plugins'.blue.bold);
809+
}
804810
State.restoreState(appDirectory, options)
805811
.then(function() {
806812
logging.logger.info('Ionic reset state complete'.green.bold);

0 commit comments

Comments
 (0)