create build directory for startup trace if missing (#5589)

This commit is contained in:
Yegor
2016-08-24 16:56:26 -07:00
committed by GitHub
parent 0e63e470e4
commit 4805d9276a

View File

@@ -155,9 +155,14 @@ class Tracing {
Future<Null> downloadStartupTrace(VMService observatory) async {
File traceInfoFile = new File('build/start_up_info.json');
// Delete old startup data, if any.
if (await traceInfoFile.exists())
await traceInfoFile.delete();
// Create "build" directory, if missing.
if (!(await traceInfoFile.parent.exists()))
await traceInfoFile.parent.create();
Tracing tracing = new Tracing(observatory);
Map<String, dynamic> timeline = await tracing.stopTracingAndDownloadTimeline(