addNewGitIgnore method

void addNewGitIgnore(
  1. String packageName
)

Implementation

void addNewGitIgnore(String packageName) {
  final path =
      join(current, 'core', 'packages', packageName.snakeCase, '.gitignore');
  if (exists(path)) {
    String gitignore = readFile(path);
    gitignore = gitignore.replaceAll('/pubspec.lock', '');
    gitignore = '''$gitignore
coverage/
test/coverage_helper_test.dart''';

    path.write(gitignore);
  } else {
    path.write('''# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
**/doc/api/
.dart_tool/
.packages
build/

coverage/
test/coverage_helper_test.dart
''');
  }
}