2024-05-23 18:06:49 +01:00
|
|
|
package executor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"codeflow.dananglin.me.uk/apollo/enbas/internal/config"
|
|
|
|
)
|
|
|
|
|
2024-08-09 19:40:46 +01:00
|
|
|
func (e *WhoamiExecutor) Execute() error {
|
|
|
|
config, err := config.NewCredentialsConfigFromFile(e.config.CredentialsFile)
|
2024-05-23 18:06:49 +01:00
|
|
|
if err != nil {
|
2024-06-02 11:35:43 +01:00
|
|
|
return fmt.Errorf("unable to load the credential config: %w", err)
|
2024-05-23 18:06:49 +01:00
|
|
|
}
|
|
|
|
|
2024-08-09 19:40:46 +01:00
|
|
|
e.printer.PrintInfo("You are logged in as '" + config.CurrentAccount + "'.\n")
|
2024-05-23 18:06:49 +01:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|