File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 179179 ],
180180 },
181181 {
182- "name" : " Debug Daemon start " ,
182+ "name" : " Debug Daemon run (touch example) " ,
183183 "type" : " go" ,
184184 "request" : " launch" ,
185185 "mode" : " debug" ,
188188 "args" : [
189189 " run" ,
190190 " --cwd" ,
191- " ${workspaceFolder}/examples/scroll-cwd" ,
192- " main.start"
193- ],
194- },
195- {
196- "name" : " Debug Daemon run switch scroll" ,
197- "type" : " go" ,
198- "request" : " launch" ,
199- "mode" : " debug" ,
200- "program" : " ${workspaceFolder}/main.go" ,
201- "args" : [
202- " run" ,
203- " scroll-switch.registry-1.docker.io/highcard/scroll-minecraft-forge:1.20.2" ,
204- " --cwd" ,
205- " ${workspaceFolder}/examples/scroll-cwd" ,
191+ " ${workspaceFolder}/examples/touch" ,
192+ " start"
206193 ],
207194 },
208195 {
Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ var PullCommand = &cobra.Command{
2323
2424 registryClient := registry .NewOciClient (host , user , password )
2525
26- registryClient .Pull (filepath .Join (cwd , ".scroll" ), artifact )
26+ err := registryClient .Pull (filepath .Join (cwd , ".scroll" ), artifact )
27+ if err != nil {
28+ logger .Log ().Error ("Failed to pull from registry" )
29+ return err
30+ }
2731
2832 logger .Log ().Info ("Pulled from registry" )
2933 return nil
Original file line number Diff line number Diff line change 88 "github.com/highcard-dev/daemon/internal/utils/logger"
99 "github.com/spf13/cobra"
1010 "github.com/spf13/viper"
11+ "go.uber.org/zap"
1112)
1213
1314var RunCmd = & cobra.Command {
@@ -16,6 +17,7 @@ var RunCmd = &cobra.Command{
1617 Args : cobra .ExactArgs (1 ),
1718 Long : `This command runs a single command from the scroll file.` ,
1819 RunE : func (cmd * cobra.Command , args []string ) error {
20+ command := args [0 ]
1921
2022 host := viper .GetString ("registry.host" )
2123 user := viper .GetString ("registry.user" )
@@ -63,10 +65,18 @@ var RunCmd = &cobra.Command{
6365 return err
6466 }
6567
66- command := args [0 ]
68+ logger .Log ().Info ("Staring queue" )
69+ go queueManager .Work ()
6770
71+ logger .Log ().Info ("Adding command to queue" , zap .String ("command" , command ))
6872 err = queueManager .AddTempItem (command )
69- return err
73+ if err != nil {
74+ return err
75+ }
76+
77+ queueManager .WaitUntilEmpty ()
78+
79+ return nil
7080 },
7181}
7282
You can’t perform that action at this time.
0 commit comments