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 {
try {
final password = argResults!['password'] as String;
final input = argResults!.rest.isNotEmpty
? argResults!.rest[0]
: '.env.encrypted';
final output = argResults!.rest.length > 1
? argResults!.rest[1]
: '.env.decrypted';
await EnvCrypto.decryptFile(input, output, password);
CliLogger.success('Decryption completed successfully');
return 0;
} catch (e) {
CliLogger.error('Decryption failed: $e');
return 64;
}
}