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

Unified Diff: lib/src/global_packages.dart

Issue 1248483003: Write binstubs using the system encoding. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 5 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 | lib/src/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index be7bad935599c67c50dad56a330d530ff349053e..60eef15afae1be1b1d15ee9c9a263eec31431290 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -5,6 +5,7 @@
library pub.global_packages;
import 'dart:async';
+import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as p;
@@ -694,7 +695,9 @@ pub global run ${package.name}:$script "\$@"
""";
}
- writeTextFile(binStubPath, bash);
+ // Write this as the system encoding since the system is going to execute
+ // it and it might contain non-ASCII caharacters in the pathnames.
+ writeTextFile(binStubPath, bash, encoding: const SystemEncoding());
// Make it executable.
var result = Process.runSync('chmod', ['+x', binStubPath]);
« no previous file with comments | « no previous file | lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698