| OLD | NEW |
| 1 library pub.barback.asset_environment; | 1 library pub.barback.asset_environment; |
| 2 import 'dart:async'; | 2 import 'dart:async'; |
| 3 import 'dart:io'; | 3 import 'dart:io'; |
| 4 import 'package:barback/barback.dart'; | 4 import 'package:barback/barback.dart'; |
| 5 import 'package:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
| 6 import 'package:watcher/watcher.dart'; | 6 import 'package:watcher/watcher.dart'; |
| 7 import '../entrypoint.dart'; | 7 import '../entrypoint.dart'; |
| 8 import '../exceptions.dart'; | 8 import '../exceptions.dart'; |
| 9 import '../io.dart'; | 9 import '../io.dart'; |
| 10 import '../log.dart' as log; | 10 import '../log.dart' as log; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 var basename = path.url.basename(id.path); | 125 var basename = path.url.basename(id.path); |
| 126 var snapshotPath = path.join(directory, "$basename.snapshot"); | 126 var snapshotPath = path.join(directory, "$basename.snapshot"); |
| 127 return runProcess( | 127 return runProcess( |
| 128 Platform.executable, | 128 Platform.executable, |
| 129 [ | 129 [ |
| 130 '--snapshot=$snapshotPath', | 130 '--snapshot=$snapshotPath', |
| 131 server.url.resolve(basename).toString()]).then((result) { | 131 server.url.resolve(basename).toString()]).then((result) { |
| 132 if (result.success) { | 132 if (result.success) { |
| 133 log.message("Precompiled ${_formatExecutable(id)}."); | 133 log.message("Precompiled ${_formatExecutable(id)}."); |
| 134 } else { | 134 } else { |
| 135 deleteEntry(snapshotPath); | |
| 136 throw new ApplicationException( | 135 throw new ApplicationException( |
| 137 log.yellow("Failed to precompile " "${_formatExecutable(id)}:\n"
) + | 136 log.yellow("Failed to precompile " "${_formatExecutable(id)}:\n"
) + |
| 138 result.stderr.join('\n')); | 137 result.stderr.join('\n')); |
| 139 } | 138 } |
| 140 }); | 139 }); |
| 141 })).whenComplete(() { | 140 })).whenComplete(() { |
| 142 server.close(); | 141 server.close(); |
| 143 }); | 142 }); |
| 144 }); | 143 }); |
| 145 } | 144 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 const _PollingWatcherType(); | 450 const _PollingWatcherType(); |
| 452 DirectoryWatcher create(String directory) => | 451 DirectoryWatcher create(String directory) => |
| 453 new PollingDirectoryWatcher(directory); | 452 new PollingDirectoryWatcher(directory); |
| 454 String toString() => "polling"; | 453 String toString() => "polling"; |
| 455 } | 454 } |
| 456 class _NoneWatcherType implements WatcherType { | 455 class _NoneWatcherType implements WatcherType { |
| 457 const _NoneWatcherType(); | 456 const _NoneWatcherType(); |
| 458 DirectoryWatcher create(String directory) => null; | 457 DirectoryWatcher create(String directory) => null; |
| 459 String toString() => "none"; | 458 String toString() => "none"; |
| 460 } | 459 } |
| OLD | NEW |