@@ -6,11 +6,13 @@ import (
66
77 "github.com/spf13/cobra"
88
9+ "github.com/bcmi-labs/orchestrator/cmd/arduino-app-cli/internal/servicelocator"
910 "github.com/bcmi-labs/orchestrator/cmd/feedback"
1011 "github.com/bcmi-labs/orchestrator/internal/orchestrator"
12+ "github.com/bcmi-labs/orchestrator/internal/orchestrator/config"
1113)
1214
13- func newCreateCmd () * cobra.Command {
15+ func newCreateCmd (cfg config. Configuration ) * cobra.Command {
1416 var (
1517 icon string
1618 bricks []string
@@ -26,7 +28,7 @@ func newCreateCmd() *cobra.Command {
2628 RunE : func (cmd * cobra.Command , args []string ) error {
2729 cobra .MinimumNArgs (1 )
2830 name := args [0 ]
29- return createHandler (cmd .Context (), name , icon , noPyton , noSketch , fromApp )
31+ return createHandler (cmd .Context (), cfg , name , icon , noPyton , noSketch , fromApp )
3032 },
3133 }
3234
@@ -40,9 +42,9 @@ func newCreateCmd() *cobra.Command {
4042 return cmd
4143}
4244
43- func createHandler (ctx context.Context , name string , icon string , noPython , noSketch bool , fromApp string ) error {
45+ func createHandler (ctx context.Context , cfg config. Configuration , name string , icon string , noPython , noSketch bool , fromApp string ) error {
4446 if fromApp != "" {
45- id , err := orchestrator .ParseID (fromApp )
47+ id , err := servicelocator . GetAppIDProvider () .ParseID (fromApp )
4648 if err != nil {
4749 feedback .Fatal (err .Error (), feedback .ErrBadArgument )
4850 return nil
@@ -51,7 +53,7 @@ func createHandler(ctx context.Context, name string, icon string, noPython, noSk
5153 resp , err := orchestrator .CloneApp (ctx , orchestrator.CloneAppRequest {
5254 Name : & name ,
5355 FromID : id ,
54- })
56+ }, servicelocator . GetAppIDProvider (), cfg )
5557 if err != nil {
5658 feedback .Fatal (err .Error (), feedback .ErrGeneric )
5759 return nil
@@ -70,7 +72,7 @@ func createHandler(ctx context.Context, name string, icon string, noPython, noSk
7072 Icon : icon ,
7173 SkipPython : noPython ,
7274 SkipSketch : noSketch ,
73- })
75+ }, servicelocator . GetAppIDProvider (), cfg )
7476 if err != nil {
7577 feedback .Fatal (err .Error (), feedback .ErrGeneric )
7678 return nil
0 commit comments