I'm hoping to create templates for pubspec.yml, ask users to supply the name of their package and then output a version of the pubspec.yml populated with their package.
Right now, I'm leaning towards using string interpolation but I believe that would require the strings to be available at compile time. In this case I'd like to be able to load the template from a file, do some form of string replacement to inject the package name and other information, then save the rendered file back to the file system.
Normally I would pull in a separate package to do this, but given that this is pub I am assuming I am restricted to using what's available in the standard Dart library.
Can anyone offer some guidance here? I've search the api documentation to no avail.
UPDATE: To be clear, I'm hoping to contribue a "pub init" command to pub itself. Since this will be part of pub, pub won't be available yet so I can't depend on loading a Dart package.