run method
Runs this command.
The return value is wrapped in a Future if necessary and returned by
CommandRunner.runCommand.
Implementation
@override
Future<int> run() async {
final configFile = File(_configPath);
if (!configFile.existsSync()) {
logger.info('No configuration file to delete');
return ExitCode.success.code;
}
try {
configFile.deleteSync();
logger.success('Configuration deleted successfully!');
logger.info('');
logger.info('Deleted: ${darkGray.wrap(_configPath)}');
return ExitCode.success.code;
} catch (e) {
logger.err('Failed to delete configuration: $e');
return ExitCode.software.code;
}
}