tui plugins (#19347)
This commit is contained in:
@@ -6,6 +6,7 @@ import { UI } from "../ui"
|
||||
import { cmd } from "./cmd"
|
||||
import { JsonMigration } from "../../storage/json-migration"
|
||||
import { EOL } from "os"
|
||||
import { errorMessage } from "../../util/error"
|
||||
|
||||
const QueryCommand = cmd({
|
||||
command: "$0 [query]",
|
||||
@@ -39,7 +40,7 @@ const QueryCommand = cmd({
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
UI.error(err instanceof Error ? err.message : String(err))
|
||||
UI.error(errorMessage(err))
|
||||
process.exit(1)
|
||||
}
|
||||
db.close()
|
||||
@@ -100,7 +101,7 @@ const MigrateCommand = cmd({
|
||||
}
|
||||
} catch (err) {
|
||||
if (tty) process.stderr.write("\x1b[?25h")
|
||||
UI.error(`Migration failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
UI.error(`Migration failed: ${errorMessage(err)}`)
|
||||
process.exit(1)
|
||||
} finally {
|
||||
sqlite.close()
|
||||
|
||||
Reference in New Issue
Block a user