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