Show VM not running warning in list
This commit is contained in:
parent
a193bf5cad
commit
661e6f3450
|
|
@ -2,7 +2,7 @@ import { homedir } from "os"
|
|||
import * as git from "../git.ts"
|
||||
import * as vm from "../vm.ts"
|
||||
import * as state from "../state.ts"
|
||||
import { reset, dim, bold, green, yellow, cyan, white } from "../fmt.ts"
|
||||
import { reset, dim, bold, green, yellow, cyan, white, red } from "../fmt.ts"
|
||||
|
||||
export async function action(opts: { json?: boolean }) {
|
||||
const root = await git.repoRoot()
|
||||
|
|
@ -37,6 +37,9 @@ export async function action(opts: { json?: boolean }) {
|
|||
|
||||
if (sessions.length === 0) {
|
||||
console.log("◆ No active sessions.")
|
||||
if ((await vm.status()) !== "running") {
|
||||
console.log(`${red}VM is not running.${reset}`)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -77,4 +80,8 @@ export async function action(opts: { json?: boolean }) {
|
|||
}
|
||||
|
||||
console.log(`\n${dim}◯ idle${reset} · ${cyan}◎ active${reset} · ${yellow}◐ unsaved${reset} · ${green}● saved${reset}`)
|
||||
|
||||
if ((await vm.status()) !== "running") {
|
||||
console.log(`${red}VM is not running.${reset}`)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ export const reset = "\x1b[0m"
|
|||
export const dim = "\x1b[2m"
|
||||
export const green = "\x1b[32m"
|
||||
export const yellow = "\x1b[33m"
|
||||
export const red = "\x1b[31m"
|
||||
export const cyan = "\x1b[36m"
|
||||
|
||||
// ── Formatted output ────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user