addNewFeatureInPubspec method
Implementation
void addNewFeatureInPubspec(
String pathFeature, String featureName, String appsName) {
String pathPubspec = join(current, 'pubspec.yaml');
if (appsName.isNotEmpty) {
pathPubspec = join(current, 'apps', appsName, 'pubspec.yaml');
}
if (!exists(pathPubspec)) {
return;
}
String pubspec = File(pathPubspec).readAsStringSync();
pubspec = pubspec.replaceAll(
RegExp(r'(^\n?dev_dependencies)', multiLine: true),
''' $featureName:
path: ./features/$featureName
dev_dependencies''',
);
pathPubspec.write(pubspec);
StatusHelper.generated(pathPubspec);
}