输出配置文件路径
This commit is contained in:
@@ -255,6 +255,7 @@ EOF
|
||||
fi
|
||||
|
||||
log_info "配置文件已生成: ${CONFIG_FILE}"
|
||||
echo -e "${GREEN}配置文件路径: ${CONFIG_FILE}${PLAIN}"
|
||||
}
|
||||
|
||||
# 配置 Systemd 服务
|
||||
|
||||
Binary file not shown.
@@ -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}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user