UNPKG

@basictech/cli

Version:

Basic CLI for creating & managing your projects

19 lines 652 B
import { AuthService } from '../lib/auth.js'; import { isOnline } from '../lib/platform.js'; import { MESSAGES } from '../lib/constants.js'; export async function AccountCommand() { if (!(await isOnline())) { throw new Error(MESSAGES.OFFLINE); } const authService = AuthService.getInstance(); const token = await authService.getToken(); if (!token) { throw new Error(MESSAGES.LOGGED_OUT); } const userInfo = await authService.getUserInfo(); console.log(` Email: ${userInfo.email}`); if (userInfo.name) { console.log(` Name: ${userInfo.name}`); } } //# sourceMappingURL=account.js.map