@@ -32,7 +32,16 @@ function copyErrorLoggerExtensions(privateDir) {
3232 fs . copySync ( from , to ) ;
3333}
3434
35- async function installPrivateResources ( ) {
35+ function installClientSyncPackage ( ) {
36+ console . log ( "\n---> Linking client-sync" )
37+ // link client-sync
38+ const clientSyncDir = path . resolve ( path . join ( 'packages' , 'client-sync' ) ) ;
39+ const destination = path . resolve ( path . join ( 'packages' , 'client-app' , 'internal_packages' , 'client-sync' ) ) ;
40+ unlinkIfExistsSync ( destination ) ;
41+ fs . symlinkSync ( clientSyncDir , destination , 'dir' ) ;
42+ }
43+
44+ function installPrivateResources ( ) {
3645 console . log ( "\n---> Linking private plugins" )
3746 const privateDir = path . resolve ( path . join ( 'packages' , 'client-private-plugins' ) )
3847 if ( ! fs . existsSync ( privateDir ) ) {
@@ -49,12 +58,6 @@ async function installPrivateResources() {
4958 unlinkIfExistsSync ( to ) ;
5059 fs . symlinkSync ( from , to , 'dir' ) ;
5160 }
52-
53- // link client-sync
54- const clientSyncDir = path . resolve ( path . join ( 'packages' , 'client-sync' ) ) ;
55- const destination = path . resolve ( path . join ( 'packages' , 'client-app' , 'internal_packages' , 'client-sync' ) ) ;
56- unlinkIfExistsSync ( destination ) ;
57- fs . symlinkSync ( clientSyncDir , destination , 'dir' ) ;
5861}
5962
6063async function lernaBootstrap ( installTarget ) {
@@ -124,11 +127,16 @@ function linkJasmineConfigs() {
124127 console . log ( "\n---> Linking Jasmine configs" ) ;
125128 const linkToPackages = [ 'cloud-api' , 'cloud-core' , 'cloud-workers' ]
126129 const from = getJasmineConfigPath ( 'isomorphic-core' )
127-
128130 for ( const packageName of linkToPackages ) {
129- const dir = getJasmineDir ( packageName )
130- if ( ! fs . existsSync ( dir ) ) {
131- fs . mkdirSync ( dir )
131+ const packageDir = path . join ( 'packages' , packageName )
132+ if ( ! fs . existsSync ( packageDir ) ) {
133+ console . log ( "\n---> No cloud packages to link. Moving on" )
134+ return
135+ }
136+
137+ const jasmineDir = getJasmineDir ( packageName )
138+ if ( ! fs . existsSync ( jasmineDir ) ) {
139+ fs . mkdirSync ( jasmineDir )
132140 }
133141 const to = getJasmineConfigPath ( packageName )
134142 unlinkIfExistsSync ( to )
@@ -161,7 +169,8 @@ async function main() {
161169 console . log ( `\n---> Installing for target ${ installTarget } ` ) ;
162170
163171 if ( [ TARGET_ALL , TARGET_CLIENT ] . includes ( installTarget ) ) {
164- await installPrivateResources ( )
172+ installPrivateResources ( )
173+ installClientSyncPackage ( )
165174 }
166175
167176 await lernaBootstrap ( installTarget ) ;
0 commit comments