run method
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand
.
Implementation
@override
Future<void> run() async {
AuthStatus isUserLoggedIn = await Auth.isAuthenticated;
if (isUserLoggedIn == AuthStatus.notAuthenticated) {
wtLog.info('You are not logged in');
return;
} else if (isUserLoggedIn == AuthStatus.authenticationExpired) {
final tokenRefreshed = await Auth.refreshToken();
// token refreshed failed. Stopping the further command execution
if (!tokenRefreshed) {
return;
}
}
await AgentOperation().publishAgent(isTest);
}