@@ -33,6 +33,11 @@ export async function writeClientIndex(
33
33
exportModels : boolean ,
34
34
exportSchemas : boolean
35
35
) : Promise < void > {
36
+ const modelsRelativePath = relative ( outputPath , modelsPath ) ;
37
+ const schemasRelativePath = relative ( outputPath , schemasPath ) ;
38
+ const servicesRelativePath = relative ( outputPath , servicesPath ) ;
39
+ const coreRelativePath = relative ( outputPath , corePath ) ;
40
+
36
41
await writeFile (
37
42
resolve ( outputPath , 'index.ts' ) ,
38
43
templates . index ( {
@@ -45,10 +50,10 @@ export async function writeClientIndex(
45
50
version : client . version ,
46
51
models : sortModelsByName ( client . models ) ,
47
52
services : sortServicesByName ( client . services ) ,
48
- modelsPath : relative ( outputPath , modelsPath ) ,
49
- schemasPath : relative ( outputPath , schemasPath ) ,
50
- servicesPath : relative ( outputPath , servicesPath ) ,
51
- corePath : relative ( outputPath , corePath ) ,
53
+ modelsPath : modelsRelativePath . startsWith ( '../' ) ? modelsRelativePath : `./ ${ modelsRelativePath } ` ,
54
+ schemasPath : schemasRelativePath . startsWith ( '../' ) ? schemasRelativePath : `./ ${ schemasRelativePath } ` ,
55
+ servicesPath : servicesRelativePath . startsWith ( '../' ) ? servicesRelativePath : `./ ${ servicesRelativePath } ` ,
56
+ corePath : coreRelativePath . startsWith ( '../' ) ? coreRelativePath : `./ ${ coreRelativePath } ` ,
52
57
} )
53
58
) ;
54
59
}
0 commit comments