From 967c9cd62bc86c3946b28b27dbfdfac796358af3 Mon Sep 17 00:00:00 2001 From: quinm0 Date: Sun, 3 May 2026 15:10:47 -0400 Subject: [PATCH] quick test --- bun/soupclown/src/interface/cli.ts | 7 ++++--- bun/soupclown/src/interface/host.ts | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 bun/soupclown/src/interface/host.ts diff --git a/bun/soupclown/src/interface/cli.ts b/bun/soupclown/src/interface/cli.ts index 6e00251..85bfbbd 100644 --- a/bun/soupclown/src/interface/cli.ts +++ b/bun/soupclown/src/interface/cli.ts @@ -1,5 +1,5 @@ -import { Command, program } from "commander"; -import { SC_CONFIG } from "./config"; +import { Command } from "commander"; +import { HOST } from "./host"; export function RUN_CLI(){ const c = new Command(); @@ -10,12 +10,13 @@ export function RUN_CLI(){ c .command('host ') - .action((action, opts) => { + .action(async (action, opts) => { console.log(opts) switch(action){ case 'init': console.log('init action!') + console.log(`HOSTNAME: ${await HOST.getHostname()}`) break; default: diff --git a/bun/soupclown/src/interface/host.ts b/bun/soupclown/src/interface/host.ts new file mode 100644 index 0000000..cb68d44 --- /dev/null +++ b/bun/soupclown/src/interface/host.ts @@ -0,0 +1,10 @@ +import { $ } from "bun"; + +async function getHostname(){ + const result = await $`hostname`.quiet().text(); + return result.trim(); +} + +export const HOST = { + getHostname, +} \ No newline at end of file