输出配置文件路径
This commit is contained in:
@@ -255,6 +255,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log_info "配置文件已生成: ${CONFIG_FILE}"
|
log_info "配置文件已生成: ${CONFIG_FILE}"
|
||||||
|
echo -e "${GREEN}配置文件路径: ${CONFIG_FILE}${PLAIN}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 配置 Systemd 服务
|
# 配置 Systemd 服务
|
||||||
|
|||||||
Binary file not shown.
@@ -2,6 +2,8 @@ package ui
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -96,7 +98,8 @@ type checkMsg struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type actionResultMsg struct {
|
type actionResultMsg struct {
|
||||||
err error
|
err error
|
||||||
|
successMsg string
|
||||||
}
|
}
|
||||||
|
|
||||||
type progressMsg string
|
type progressMsg string
|
||||||
@@ -196,7 +199,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
m.actionErr = msg.err
|
m.actionErr = msg.err
|
||||||
m.actionDone = true
|
m.actionDone = true
|
||||||
if msg.err == nil {
|
if msg.err == nil {
|
||||||
m.progressMsg = "操作成功完成!"
|
if msg.successMsg != "" {
|
||||||
|
m.progressMsg = msg.successMsg
|
||||||
|
} else {
|
||||||
|
m.progressMsg = "操作成功完成!"
|
||||||
|
}
|
||||||
if m.actionType == ActionStartGateway {
|
if m.actionType == ActionStartGateway {
|
||||||
m.DidStartGateway = true
|
m.DidStartGateway = true
|
||||||
}
|
}
|
||||||
@@ -691,7 +698,13 @@ func runUninstallCmd() tea.Msg {
|
|||||||
func runSaveConfigCmd(opts sys.ConfigOptions) tea.Cmd {
|
func runSaveConfigCmd(opts sys.ConfigOptions) tea.Cmd {
|
||||||
return func() tea.Msg {
|
return func() tea.Msg {
|
||||||
err := sys.GenerateAndWriteConfig(opts)
|
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