Index: lib/src/codegen/js_printer.dart |
diff --git a/lib/src/codegen/js_printer.dart b/lib/src/codegen/js_printer.dart |
index e5545e6e42d39bfa9e387bc780796e658897c1c8..37584724776ebf564d059c256de5ae46ed94d620 100644 |
--- a/lib/src/codegen/js_printer.dart |
+++ b/lib/src/codegen/js_printer.dart |
@@ -4,7 +4,7 @@ |
library dev_compiler.src.codegen.js_printer; |
-import 'dart:io' show Directory, File; |
+import 'dart:io' show Directory, File, Platform, Process; |
import 'package:analyzer/src/generated/ast.dart'; |
import 'package:path/path.dart' as path; |
import 'package:source_maps/source_maps.dart' as srcmaps show Printer; |
@@ -48,6 +48,12 @@ String writeJsLibrary(JS.Program jsTree, String outputPath, |
text = (context as JS.SimpleJavaScriptPrintingContext).getText(); |
} |
new File(outputPath).writeAsStringSync(text); |
+ if (jsTree.scriptTag != null) { |
+ // Mark executable. |
+ // TODO(jmesserly): should only do this if the input file was executable? |
+ if (!Platform.isWindows) Process.runSync('chmod', ['+x', outputPath]); |
+ } |
+ |
return computeHash(text); |
} |