输出配置文件路径

This commit is contained in:
user123
2026-01-30 18:13:59 +08:00
parent d9e4110967
commit 9109960c4a
3 changed files with 17 additions and 3 deletions

View File

@@ -255,6 +255,7 @@ EOF
fi
log_info "配置文件已生成: ${CONFIG_FILE}"
echo -e "${GREEN}配置文件路径: ${CONFIG_FILE}${PLAIN}"
}
# 配置 Systemd 服务

Binary file not shown.

View File

@@ -2,6 +2,8 @@ package ui
import (
"fmt"
"os"
"path/filepath"
"strings"
"time"
@@ -97,6 +99,7 @@ type checkMsg struct {
type actionResultMsg struct {
err error
successMsg string
}
type progressMsg string
@@ -196,7 +199,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.actionErr = msg.err
m.actionDone = true
if msg.err == nil {
if msg.successMsg != "" {
m.progressMsg = msg.successMsg
} else {
m.progressMsg = "操作成功完成!"
}
if m.actionType == ActionStartGateway {
m.DidStartGateway = true
}
@@ -691,7 +698,13 @@ func runUninstallCmd() tea.Msg {
func runSaveConfigCmd(opts sys.ConfigOptions) tea.Cmd {
return func() tea.Msg {
err := sys.GenerateAndWriteConfig(opts)
return actionResultMsg{err: err}
msg := ""
if err == nil {
userHome, _ := os.UserHomeDir()
path := filepath.Join(userHome, ".openclaw", "openclaw.json")
msg = fmt.Sprintf("配置文件路径: %s", path)
}
return actionResultMsg{err: err, successMsg: msg}
}
}