-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathws.go
41 lines (34 loc) · 955 Bytes
/
ws.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
ws "github.com/windler/ws/app"
"github.com/windler/ws/app/commands"
"github.com/windler/ws/app/config"
"github.com/windler/ws/app/git"
"github.com/windler/ws/app/ui"
)
func main() {
yamlRepo := config.CreateYamlRepository()
app := ws.CreateNewApp("1.1.0", yamlRepo)
ui := ui.ConsoleUI{}
workspaceRetriever := &commands.FSWorkspaceRetriever{}
executor := &commands.SHExecutor{
WSRetriever: workspaceRetriever,
}
listWsFactory := &commands.ListWsFactory{
InfoRetriever: git.New(),
UserInterface: ui,
Executor: executor,
WSRetriever: workspaceRetriever,
}
app.AddCommand(listWsFactory.CreateCommand(), yamlRepo)
for _, cmd := range yamlRepo.GetCustomCommands() {
ccFactory := &commands.CustomCommandFactory{
UserInterface: ui,
Cmd: cmd,
Executor: executor,
WSRetriever: workspaceRetriever,
}
app.AddCommand(ccFactory.CreateCommand(), yamlRepo)
}
app.Start()
}