mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 09:14:22 +01:00
feat: home dir in app info
This commit is contained in:
@@ -15,6 +15,7 @@ export namespace App {
|
|||||||
hostname: z.string(),
|
hostname: z.string(),
|
||||||
git: z.boolean(),
|
git: z.boolean(),
|
||||||
path: z.object({
|
path: z.object({
|
||||||
|
home: z.string(),
|
||||||
config: z.string(),
|
config: z.string(),
|
||||||
data: z.string(),
|
data: z.string(),
|
||||||
root: z.string(),
|
root: z.string(),
|
||||||
@@ -75,6 +76,7 @@ export namespace App {
|
|||||||
},
|
},
|
||||||
git: git !== undefined,
|
git: git !== undefined,
|
||||||
path: {
|
path: {
|
||||||
|
home: os.homedir(),
|
||||||
config: Global.Path.config,
|
config: Global.Path.config,
|
||||||
state: Global.Path.state,
|
state: Global.Path.state,
|
||||||
data,
|
data,
|
||||||
|
|||||||
20
packages/opencode/src/cli/cmd/debug/app.ts
Normal file
20
packages/opencode/src/cli/cmd/debug/app.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { App } from "../../../app/app"
|
||||||
|
import { bootstrap } from "../../bootstrap"
|
||||||
|
import { cmd } from "../cmd"
|
||||||
|
|
||||||
|
const AppInfoCommand = cmd({
|
||||||
|
command: "info",
|
||||||
|
builder: (yargs) => yargs,
|
||||||
|
async handler() {
|
||||||
|
await bootstrap({ cwd: process.cwd() }, async () => {
|
||||||
|
const app = App.info()
|
||||||
|
console.log(JSON.stringify(app, null, 2))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const AppCommand = cmd({
|
||||||
|
command: "app",
|
||||||
|
builder: (yargs) => yargs.command(AppInfoCommand).demandCommand(),
|
||||||
|
async handler() {},
|
||||||
|
})
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Global } from "../../../global"
|
import { Global } from "../../../global"
|
||||||
import { bootstrap } from "../../bootstrap"
|
import { bootstrap } from "../../bootstrap"
|
||||||
import { cmd } from "../cmd"
|
import { cmd } from "../cmd"
|
||||||
|
import { AppCommand } from "./app"
|
||||||
import { FileCommand } from "./file"
|
import { FileCommand } from "./file"
|
||||||
import { LSPCommand } from "./lsp"
|
import { LSPCommand } from "./lsp"
|
||||||
import { RipgrepCommand } from "./ripgrep"
|
import { RipgrepCommand } from "./ripgrep"
|
||||||
@@ -11,6 +12,7 @@ export const DebugCommand = cmd({
|
|||||||
command: "debug",
|
command: "debug",
|
||||||
builder: (yargs) =>
|
builder: (yargs) =>
|
||||||
yargs
|
yargs
|
||||||
|
.command(AppCommand)
|
||||||
.command(LSPCommand)
|
.command(LSPCommand)
|
||||||
.command(RipgrepCommand)
|
.command(RipgrepCommand)
|
||||||
.command(FileCommand)
|
.command(FileCommand)
|
||||||
|
|||||||
@@ -552,6 +552,7 @@ export type App = {
|
|||||||
hostname: string
|
hostname: string
|
||||||
git: boolean
|
git: boolean
|
||||||
path: {
|
path: {
|
||||||
|
home: string
|
||||||
config: string
|
config: string
|
||||||
data: string
|
data: string
|
||||||
root: string
|
root: string
|
||||||
|
|||||||
Reference in New Issue
Block a user