Skip to content

Commit

Permalink
fix(@angular-devkit/core): ensure long workspace value changes are mu…
Browse files Browse the repository at this point in the history
…ltiline
  • Loading branch information
clydin authored and alexeagle committed Apr 16, 2019
1 parent 58f6282 commit a3811a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/angular_devkit/core/src/workspace/json/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ function updateJsonWorkspace(metadata: JsonWorkspaceMetadata): string {
new Map<JsonAstNode | JsonAstKeyValue, (JsonAstNode | JsonAstKeyValue | string)[]>();

for (const { op, path, node, value, type } of metadata.changes) {
const multiline = node.start.line !== node.end.line;
// targets/projects are typically large objects so always use multiline
const multiline = node.start.line !== node.end.line || type !== 'json';
const pathSegments = path.split('/');
const depth = pathSegments.length - 1; // TODO: more complete analysis
const propertyOrIndex = unescapeKey(pathSegments[depth]);
Expand Down

0 comments on commit a3811a7

Please sign in to comment.