From 6dc7de4cb58d198faa7f933e4ea77adb56139a68 Mon Sep 17 00:00:00 2001 From: Juri Strumpflohner Date: Thu, 25 Feb 2021 16:49:14 +0100 Subject: [PATCH] fix(core): fix(core): fix(core): ensure dir when exporting dep-graph to json (#4893) --- packages/workspace/src/command-line/dep-graph.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/workspace/src/command-line/dep-graph.ts b/packages/workspace/src/command-line/dep-graph.ts index 3f209bda1d..5b68a8ad19 100644 --- a/packages/workspace/src/command-line/dep-graph.ts +++ b/packages/workspace/src/command-line/dep-graph.ts @@ -2,7 +2,8 @@ import { exists, readFile, readFileSync, statSync, writeFileSync } from 'fs'; import { copySync } from 'fs-extra'; import * as http from 'http'; import * as opn from 'opn'; -import { join, normalize, parse } from 'path'; +import { join, normalize, parse, dirname } from 'path'; +import { ensureDirSync } from 'fs-extra'; import * as url from 'url'; import { createProjectGraph, @@ -238,6 +239,8 @@ export function generateGraph( } else if (ext === 'json') { filename = `${folder}/${filename}`; + ensureDirSync(dirname(filename)); + writeFileSync( filename, JSON.stringify(