Documentation
¶
Overview ¶
Package config 提供 forge 的本地配置读写(例如默认 root 目录)。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppConfigDir ¶
func BaseConfigDir ¶
BaseConfigDir 返回配置根目录(不含应用子目录)。
优先级: 1) FORGE_CONFIG_DIR 2) XDG_CONFIG_HOME 3) ~/.config
func ConfigPath ¶
Types ¶
type CommandConfig ¶
type CommandConfig struct {
Name string `json:"name"` // TUI 中显示的名称
Command string `json:"command"` // 可执行文件名(需在 $PATH 中)
Args []string `json:"args"` // 传给命令的参数列表
}
CommandConfig 描述一个可执行的启动命令。
type Config ¶
type Config struct {
Root string `json:"root"`
Commands []CommandConfig `json:"commands,omitempty"`
Projects []ProjectConfig `json:"projects,omitempty"`
}
func (Config) GetCommands ¶
func (c Config) GetCommands() []CommandConfig
GetCommands 返回配置中的命令列表;如果用户未自定义则返回默认值。
type ProjectConfig ¶
type ProjectConfig struct {
Name string `json:"name"` // 显示名称(如 "my-blog")
Path string `json:"path"` // 项目路径(如 "~/Projects/my-blog")
}
ProjectConfig 描述一个项目书签,用于快速跳转。
Click to show internal directories.
Click to hide internal directories.