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

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

Issue 344413004: Support pub --with-prejudice. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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 | « sdk/lib/_internal/pub/lib/src/progress.dart ('k') | sdk/lib/_internal/pub/test/pub_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f904c32459a2a70f76ec5c90d26901e58c42278..24c9ecfc76ed0d6f42d327540f52cd139e2ab65e 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -714,6 +714,15 @@ String prefixLines(String text, {String prefix: '| ', String firstPrefix}) {
/// test that has explicitly set this.
bool runningAsTest = Platform.environment.containsKey('_PUB_TESTING');
+/// Whether today is April Fools' day.
+bool get isAprilFools {
+ // Tests should never see April Fools' output.
+ if (runningAsTest) return false;
+
+ var date = new DateTime.now();
+ return date.month == 4 && date.day == 1;
+}
+
/// Wraps [fn] to guard against several different kinds of stack overflow
/// exceptions:
///
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/progress.dart ('k') | sdk/lib/_internal/pub/test/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698