refactor: add commands

This commit is contained in:
Mauricio Siu
2024-06-22 00:52:17 -06:00
parent fbf6b7f5cc
commit d610c967d9
19 changed files with 779 additions and 1154 deletions

View File

@@ -9,9 +9,12 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const configPath = path.join(__dirname, "..", "..", "config.json");
export const readAuthConfig = async (
command: Command,
): Promise<{ token: string; url: string }> => {
export type AuthConfig = {
token: string;
url: string;
};
export const readAuthConfig = async (command: Command): Promise<AuthConfig> => {
if (!fs.existsSync(configPath)) {
command.error(
chalk.red(