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

Unified Diff: pkg/polymer/bin/new_entry.dart

Issue 541433002: if appending at end of file ensure newline (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/bin/new_entry.dart
diff --git a/pkg/polymer/bin/new_entry.dart b/pkg/polymer/bin/new_entry.dart
index 9f299e5cc022a664025d6ad7bd3197c2591e5d04..5bbcd13fb03c81489462082b80f0644c1f665f3c 100644
--- a/pkg/polymer/bin/new_entry.dart
+++ b/pkg/polymer/bin/new_entry.dart
@@ -159,7 +159,8 @@ String html = '''
} else {
// There were no transformers at all.
insertionPoint = pubspecText.length;
- textToInsert = 'transformers:\n- ';
+ var optionalNewline = pubspecText.endsWith('\n') ? '' : '\n';
+ textToInsert = '${optionalNewline}transformers:\n- ';
entryPoints = [entryPoint];
}
« 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