fix some syntax and stuff

This commit is contained in:
Darius
2025-09-26 21:44:24 +02:00
parent a0a76a8b75
commit cc5ecaf8e0
10 changed files with 346 additions and 30 deletions

View File

@@ -1,5 +1,6 @@
import { apiClient } from "../core/api-client";
import { logError, logInfo } from "./logger";
import * as readline from "node:readline";
import { apiClient } from "../core/api-client.ts";
import { logError, logInfo } from "./logger.ts";
export async function getUserId(username: string): Promise<string | null> {
const user = await apiClient.users.getUserByName(username);
@@ -10,3 +11,17 @@ export async function getUserId(username: string): Promise<string | null> {
logError(`no user with name ${username} found`);
return null;
}
export async function promptForInput(prompt: string): Promise<string> {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
return new Promise<string>((resolve) => {
rl.question(prompt, (answer) => {
rl.close();
resolve(answer.trim());
});
});
}