alwaysai
Version:
The alwaysAI command-line interface (CLI)
17 lines (15 loc) • 424 B
text/typescript
import { connectBySsh, Spinner } from '../../util';
export async function connectBySshComponent(props: {
targetHostname: string;
warnOrFail?: 'warn' | 'fail';
}) {
const { targetHostname, warnOrFail = 'fail' } = props;
const spinner = Spinner('Connect by SSH');
try {
await connectBySsh({ targetHostname });
spinner.succeed();
} catch (exception) {
spinner[warnOrFail]();
throw exception;
}
}