@@ -644,8 +644,8 @@ export class CloneHandler {
644644 importConfig . contentDir = importConfig . data ;
645645 }
646646
647- if ( ! importConfig . contentDir && importConfig . sourceStackBranch && importConfig . pathDir ) {
648- const dataPath = path . join ( importConfig . pathDir , importConfig . sourceStackBranch ) ;
647+ if ( ! importConfig . contentDir && importConfig . pathDir ) {
648+ const dataPath = importConfig . pathDir ;
649649 cmd . push ( '-d' , dataPath ) ;
650650 log . debug ( `Import data path: ${ dataPath } ` , this . config . cloneContext ) ;
651651 }
@@ -675,7 +675,7 @@ export class CloneHandler {
675675 cmd : cmd . join ( ' ' ) ,
676676 targetStack : importConfig . apiKey || importConfig . target_stack ,
677677 targetBranch : importConfig . targetStackBranch ,
678- dataPath : importConfig . contentDir || ( importConfig . pathDir && importConfig . sourceStackBranch ? path . join ( importConfig . pathDir , importConfig . sourceStackBranch ) : undefined )
678+ dataPath : importConfig . contentDir || importConfig . pathDir || undefined
679679 } ) ;
680680 log . debug ( 'Running import command' , { ...this . config . cloneContext , cmd } ) ;
681681 const importData = importCmd . run ( cmd ) ;
@@ -804,9 +804,10 @@ export class CloneHandler {
804804 ] ;
805805 let successMsg : string ;
806806 let selectedValue : any = { } ;
807- // Resolve path to package root - go up 3 levels from __dirname (core/util -> package root )
807+ // Export root only (single-branch layout: modules live directly under -d, not pathDir/<branch> )
808808 const cloneTypePackageRoot = path . resolve ( __dirname , '../../..' ) ;
809- this . config . contentDir = path . join ( cloneTypePackageRoot , 'contents' , this . config . sourceStackBranch || '' ) ;
809+ this . config . contentDir =
810+ this . config . pathDir || path . join ( cloneTypePackageRoot , 'contents' ) ;
810811 log . debug ( `Clone content directory: ${ this . config . contentDir } ` , this . config . cloneContext ) ;
811812
812813 if ( ! this . config . cloneType ) {
0 commit comments