backupPubspec method
Backup the pubspec.yaml
Implementation
void backupPubspec({String? filePath, String? targetPath}) {
try {
log("Backing up $filePath");
File(filePath ?? 'pubspec.yaml').copySync(
targetPath ?? 'pubspec_backup.yaml',
);
} catch (exception) {
stderr.writeln("Couldn't backup main pubspec.yaml");
stderr.writeln(exception);
}
}