refreshGcpAuth function

Future<bool> refreshGcpAuth(
  1. String gcpAuthRefresh
)

Refresh GCP auth (exposed for direct use).

Implementation

Future<bool> refreshGcpAuth(String gcpAuthRefresh) async {
  try {
    final result = await Process.run(
      Platform.isWindows ? 'cmd' : 'sh',
      Platform.isWindows ? ['/c', gcpAuthRefresh] : ['-c', gcpAuthRefresh],
    );
    return result.exitCode == 0;
  } catch (e) {
    stderr.writeln('Error running gcpAuthRefresh: $e');
    return false;
  }
}