Browse Source

Revert "Closes #15322"

This reverts commit 1ba05cc385.
pull/15326/head
Engincan VESKE 4 years ago
parent
commit
e19ca73289
  1. 22
      npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts

22
npm/ng-packs/packages/schematics/src/commands/change-theme/index.ts

@ -2,7 +2,7 @@ import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devk
import { isLibrary, updateWorkspace, WorkspaceDefinition } from '../../utils'; import { isLibrary, updateWorkspace, WorkspaceDefinition } from '../../utils';
import { allStyles, styleMap } from './style-map'; import { allStyles, styleMap } from './style-map';
import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; import { ProjectDefinition } from '@angular-devkit/core/src/workspace';
import { JsonArray, JsonValue, strings } from '@angular-devkit/core'; import { JsonArray, JsonValue } from '@angular-devkit/core';
import { ChangeThemeOptions } from './model'; import { ChangeThemeOptions } from './model';
import { ThemeOptionsEnum } from './theme-options.enum'; import { ThemeOptionsEnum } from './theme-options.enum';
@ -25,25 +25,7 @@ function updateProjectStyle(
workspace: WorkspaceDefinition, workspace: WorkspaceDefinition,
targetThemeName: ThemeOptionsEnum, targetThemeName: ThemeOptionsEnum,
) { ) {
let project = workspace.projects.get(projectName); const project = workspace.projects.get(projectName);
if (!project)
try {
projectName = strings.dasherize(projectName);
project = workspace.projects.get(projectName);
} catch (_) {}
if (!project)
try {
projectName = strings.camelize(projectName);
project = workspace.projects.get(projectName);
} catch (_) {}
if (!project)
try {
projectName = strings.classify(projectName);
project = workspace.projects.get(projectName);
} catch (_) {}
if (!project) { if (!project) {
throw new SchematicsException('The target project does not selected'); throw new SchematicsException('The target project does not selected');

Loading…
Cancel
Save