Skip to content

Commit 5d7a93f

Browse files
committed
impv: move os-specific logic into service manager
1 parent 5669563 commit 5d7a93f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

models/weaveinit/run_l1_node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ func initializeApp(state *RunL1NodeState) tea.Cmd {
823823
}
824824
}
825825

826-
if err = utils.CreateService(utils.GetRunL1NodeServiceName(), utils.GetDarwinRunL1NodePlist(state.initiadVersion)); err != nil {
826+
if err = utils.CreateService(utils.GetRunL1NodeServiceName(), utils.GetRunL1NodeServiceContent(state.initiadVersion)); err != nil {
827827
panic(fmt.Sprintf("failed to create service: %v", err))
828828
}
829829

utils/service_manager.go

+16
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,22 @@ func GetRunL1NodeServiceName() string {
159159
}
160160
}
161161

162+
func GetRunL1NodeServiceContent(version string) string {
163+
switch runtime.GOOS {
164+
case "linux":
165+
return GetLinuxRunL1NodeServiceContent(version)
166+
case "darwin":
167+
return GetDarwinRunL1NodePlist(version)
168+
default:
169+
panic(fmt.Errorf("unsupported operating system: %s", runtime.GOOS))
170+
}
171+
}
172+
173+
func GetLinuxRunL1NodeServiceContent(version string) string {
174+
// TODO: Implement this function
175+
return ""
176+
}
177+
162178
func GetDarwinRunL1NodePlist(version string) string {
163179
userHome, err := os.UserHomeDir()
164180
if err != nil {

0 commit comments

Comments
 (0)