cleanup(misc): formatter changes
This commit is contained in:
parent
fb01c409bd
commit
a4d0f11e73
@ -162,5 +162,4 @@ describe('updateWorkspace Rule', () => {
|
|||||||
expect(workspace.defaultProject).toBeDefined();
|
expect(workspace.defaultProject).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,13 +8,20 @@ import { updateWorkspaceInTree, getWorkspacePath } from '@nrwl/workspace';
|
|||||||
* @param schema The options provided to the schematic
|
* @param schema The options provided to the schematic
|
||||||
*/
|
*/
|
||||||
export function updateWorkspace(schema: Schema) {
|
export function updateWorkspace(schema: Schema) {
|
||||||
return updateWorkspaceInTree((workspace, context: SchematicContext, host: Tree) => {
|
return updateWorkspaceInTree(
|
||||||
delete workspace.projects[schema.projectName];
|
(workspace, context: SchematicContext, host: Tree) => {
|
||||||
if (workspace.defaultProject && workspace.defaultProject === schema.projectName) {
|
delete workspace.projects[schema.projectName];
|
||||||
delete workspace.defaultProject;
|
if (
|
||||||
const workspacePath = getWorkspacePath(host);
|
workspace.defaultProject &&
|
||||||
context.logger.warn(`Default project was removed in ${workspacePath} because it was "${schema.projectName}". If you want a default project you should define a new one.`);
|
workspace.defaultProject === schema.projectName
|
||||||
|
) {
|
||||||
|
delete workspace.defaultProject;
|
||||||
|
const workspacePath = getWorkspacePath(host);
|
||||||
|
context.logger.warn(
|
||||||
|
`Default project was removed in ${workspacePath} because it was "${schema.projectName}". If you want a default project you should define a new one.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return workspace;
|
||||||
}
|
}
|
||||||
return workspace;
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user