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

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

Issue 473663002: Fix bug that prevent the entry point from being added to the pubspec (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
===================================================================
--- pkg/polymer/bin/new_entry.dart (revision 39220)
+++ pkg/polymer/bin/new_entry.dart (working copy)
@@ -84,7 +84,7 @@
var pubspecPath = path.join(pubspecDir, 'pubspec.yaml');
var pubspecText = new File(pubspecPath).readAsStringSync();
var transformers = loadYaml(pubspecText)['transformers'];
- var entryPoints;
+ var entryPoints = [];
var insertionPoint;
var textToInsert = '';
@@ -110,8 +110,8 @@
'for polymer transformer');
} else {
var existing = e['polymer']['entry_points'];
- entryPoints = existing == null ? [] :
- (existing is String ? [existing] : existing.toList());
+ entryPoints = (existing == null ? [] :
+ (existing is String ? [existing] : existing.toList()));
if (entryPoints.contains(entryPoint)) return false;
entryPoints.add(entryPoint);
@@ -133,6 +133,7 @@
// There were no transformers at all.
insertionPoint = pubspecText.length;
textToInsert = 'transformers:\n- ';
+ entryPoints.add(entryPoint);
Siggi Cherem (dart-lang) 2014/08/13 21:56:30 alternatively, you could remove the initialization
}
// TODO(dgrove): Once dartbug.com/20409 is addressed, use that here.
« 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