Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: lib/devc.dart

Issue 1001503003: server: create output directory if needed (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/devc.dart
diff --git a/lib/devc.dart b/lib/devc.dart
index bfe3d5d43ff02e5e4ff391c2e6fcdf95886344a8..980e2db1393619b81606b616217139632f34e3b9 100644
--- a/lib/devc.dart
+++ b/lib/devc.dart
@@ -266,6 +266,10 @@ class CompilerServer {
CompilerServer._(this.compiler, this.outDir, this.port, this._entryPath);
Future start() async {
+ // Create output directory if needed. shelf_static will fail otherwise.
+ var out = new Directory(outDir);
+ if (!await out.exists()) await out.create(recursive: true);
+
var handler = const shelf.Pipeline()
.addMiddleware(rebuildAndCache)
.addHandler(shelf_static.createStaticHandler(outDir,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698