Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Replace special-case for projectName in creation
Browse files Browse the repository at this point in the history
Updated console-full and package-simple to be valid
  • Loading branch information
kevmoo committed Dec 2, 2015
1 parent f18c733 commit a97e25d
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/generators/console_full_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bGljZW5zZSB0aGF0IGNhbiBiZSBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlLgoKaW1wb3J0ICdw
YWNrYWdlOl9fcHJvamVjdE5hbWVfXy9fX3Byb2plY3ROYW1lX18uZGFydCcgYXMgX19wcm9qZWN0
TmFtZV9fOwoKbWFpbihMaXN0PFN0cmluZz4gYXJndW1lbnRzKSB7CiAgcHJpbnQoJ0hlbGxvIHdv
cmxkOiAke19fcHJvamVjdE5hbWVfXy5jYWxjdWxhdGUoKX0hJyk7Cn0K""",
"lib/projectName.dart",
"lib/__projectName__.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
ZC4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUKLy8gaXMgZ292ZXJuZWQgYnkgYSBCU0Qtc3R5bGUg
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/package_simple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class PackageSimpleGenerator extends DefaultGenerator {
addTemplateFile(file);
}

setEntrypoint(getFile('lib/projectName.dart'));
setEntrypoint(getFile('lib/__projectName__.dart'));
}
}
8 changes: 4 additions & 4 deletions lib/generators/package_simple_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ IHsKICAgICAgdmFyIGF3ZXNvbWUgPSBuZXcgQXdlc29tZSgpOwogICAgfQoKIyMgRmVhdHVyZXMg
YW5kIGJ1Z3MKClBsZWFzZSBmaWxlIGZlYXR1cmUgcmVxdWVzdHMgYW5kIGJ1Z3MgYXQgdGhlIFtp
c3N1ZSB0cmFja2VyXVt0cmFja2VyXS4KClt0cmFja2VyXTogaHR0cDovL2V4YW1wbGUuY29tL2lz
c3Vlcy9yZXBsYWNlbWUK""",
"example/projectName.dart",
"example/__projectName___example.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
ZC4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUKLy8gaXMgZ292ZXJuZWQgYnkgYSBCU0Qtc3R5bGUg
bGljZW5zZSB0aGF0IGNhbiBiZSBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlLgoKbGlicmFyeSBf
X3Byb2plY3ROYW1lX18uZXhhbXBsZTsKCmltcG9ydCAncGFja2FnZTpfX3Byb2plY3ROYW1lX18v
X19wcm9qZWN0TmFtZV9fLmRhcnQnOwoKbWFpbigpIHsKICB2YXIgYXdlc29tZSA9IG5ldyBBd2Vz
b21lKCk7CiAgcHJpbnQoJ2F3ZXNvbWU6ICR7YXdlc29tZS5pc0F3ZXNvbWV9Jyk7Cn0K""",
"lib/projectName.dart",
"lib/__projectName__.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
ZC4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUKLy8gaXMgZ292ZXJuZWQgYnkgYSBCU0Qtc3R5bGUg
Expand All @@ -70,7 +70,7 @@ X3Byb2plY3ROYW1lX18gbGlicmFyeS4KLy8vCi8vLyBUaGlzIGlzIGFuIGF3ZXNvbWUgbGlicmFy
eS4gTW9yZSBkYXJ0ZG9jcyBnbyBoZXJlLgpsaWJyYXJ5IF9fcHJvamVjdE5hbWVfXzsKCi8vIFRP
RE86IEV4cG9ydCBhbnkgbGlicmFyaWVzIGludGVuZGVkIGZvciBjbGllbnRzIG9mIHRoaXMgcGFj
a2FnZS4KCmV4cG9ydCAnc3JjL19fcHJvamVjdE5hbWVfX19iYXNlLmRhcnQnOwo=""",
"lib/src/projectName_base.dart",
"lib/src/__projectName___base.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
ZC4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUKLy8gaXMgZ292ZXJuZWQgYnkgYSBCU0Qtc3R5bGUg
Expand All @@ -86,7 +86,7 @@ YXV0aG9yX18gPGVtYWlsQGV4YW1wbGUuY29tPgojaG9tZXBhZ2U6IGh0dHBzOi8vd3d3LmV4YW1w
bGUuY29tCgplbnZpcm9ubWVudDoKICBzZGs6ICc+PTEuMC4wIDwyLjAuMCcKCiNkZXBlbmRlbmNp
ZXM6CiMgIGxpYl9uYW1lOiBhbnkKCmRldl9kZXBlbmRlbmNpZXM6CiAgdGVzdDogJz49MC4xMi4w
IDwwLjEzLjAnCg==""",
"test/projectName_test.dart",
"test/__projectName___test.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
ZC4gVXNlIG9mIHRoaXMgc291cmNlIGNvZGUKLy8gaXMgZ292ZXJuZWQgYnkgYSBCU0Qtc3R5bGUg
Expand Down
1 change: 0 additions & 1 deletion lib/stagehand.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ abstract class Generator implements Comparable<Generator> {
return Future.forEach(files, (TemplateFile file) {
var resultFile = file.runSubstitution(vars);
String filePath = resultFile.path;
filePath = filePath.replaceAll('projectName', projectName);
return target.createFile(filePath, resultFile.content);
});
}
Expand Down

0 comments on commit a97e25d

Please sign in to comment.