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

Unified Diff: pkg/polymer/lib/src/build/runner.dart

Issue 278583004: I have no idea if this is actually what we want to do, but we are hitting the long path issue on wi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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: pkg/polymer/lib/src/build/runner.dart
===================================================================
--- pkg/polymer/lib/src/build/runner.dart (revision 35880)
+++ pkg/polymer/lib/src/build/runner.dart (working copy)
@@ -216,7 +216,20 @@
return barback.getAllAssets().then((assets) {
// Delete existing output folder before we generate anything
var dir = new Directory(options.outDir);
- if (dir.existsSync()) dir.deleteSync(recursive: true);
+ // We get very long filenames which can cause us to not be able to delete
+ // using the normal dart:io deleteSync(recursive: true) on windows
+ if (dir.existsSync()) {
+ if (Platform.operatingSystem == 'windows' ) {
+ var result = Process.runSync('rmdir', ['/q', '/s', options.outDir]);
+ if (result.exitCode != 0) {
+ throw "Could not delete $dir, output was: \n"
+ "stdout: ${result.stdout} \n"
+ "stderr: ${result.stderr}";
+ }
+ } else {
+ dir.deleteSync(recursive: true);
+ }
+ }
return _emitPackagesDir(options)
.then((_) => _emitTransformedFiles(assets, options))
.then((_) => _addPackagesSymlinks(assets, options))
« 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