@@ -29,7 +29,7 @@ func RunDependent(ctx context.Context, source, dependent string, flagsString str
29
29
return fmt .Errorf ("source must be specified" )
30
30
}
31
31
32
- wf , _ , err := utils .GetWorkflowAndDir ()
32
+ wf , projectDir , err := utils .GetWorkflowAndDir ()
33
33
if err != nil {
34
34
return err
35
35
}
@@ -45,7 +45,8 @@ func RunDependent(ctx context.Context, source, dependent string, flagsString str
45
45
return fmt .Errorf ("failed to build source %s: %w" , source , err )
46
46
}
47
47
48
- sourceLocation , err := filepath .Abs (* wf .Sources [source ].Output )
48
+ sourceLocation := filepath .Join (projectDir , * wf .Sources [source ].Output )
49
+ sourceLocation , err = filepath .Abs (sourceLocation )
49
50
if err != nil {
50
51
return fmt .Errorf ("failed to get absolute path for source output: %w" , err )
51
52
}
@@ -64,22 +65,25 @@ func RunDependent(ctx context.Context, source, dependent string, flagsString str
64
65
65
66
log .From (ctx ).Infof ("\n \n === Rebuilding SDK %s ===\n " , dependent )
66
67
67
- if err := processDependent (ctx , dependent , r , flagsString , sourceLocation ); err != nil {
68
+ if err := processDependent (ctx , dependent , r , flagsString , sourceLocation , projectDir ); err != nil {
68
69
return fmt .Errorf ("failed to process dependent %s: %w" , dependent , err )
69
70
}
70
71
}
71
72
72
73
return nil
73
74
}
74
75
75
- func processDependent (ctx context.Context , dependentName string , dependent workflow.Dependent , flagsString string , sourceLocation string ) error {
76
+ func processDependent (ctx context.Context , dependentName string , dependent workflow.Dependent , flagsString string , sourceLocation string , projectDir string ) error {
76
77
logger := log .From (ctx )
77
78
78
79
location := dependent .Location
79
80
if location == "" {
80
81
return fmt .Errorf ("dependent %s has no location specified" , dependentName )
81
82
}
82
83
84
+ // Resolve location relative to projectDir
85
+ location = filepath .Join (projectDir , location )
86
+
83
87
// Check if location exists
84
88
if _ , err := os .Stat (location ); os .IsNotExist (err ) {
85
89
cloneCommand := dependent .CloneCommand
0 commit comments