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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 20204003: First stab at a dev server in pub using barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 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
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index 16e7bef099a59d45fbc446235625b26a945b105d..6a048cf1612a5184c6c0b0d309dc4cec16c561c9 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -72,6 +72,14 @@ class FutureGroup<T> {
Future<List> get future => _completer.future;
}
+/// Returns [posix] on POSIX machines and [windows] on Windows.
+///
+/// If [windows] is omitted, returns `""` on Windows.
+String getPlatformString(String posix, [String windows]) {
+ if (windows == null) windows = "";
+ return Platform.operatingSystem == "windows" ? windows : posix;
+}
+
/// Like [new Future], but avoids around issue 11911 by using [new Future.value]
/// under the covers.
Future newFuture(callback()) => new Future.value().then((_) => callback());

Powered by Google App Engine
This is Rietveld 408576698