File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ let fs = require('fs');
2121let path = require ( 'path' ) ;
2222let log = require ( './logger.js' ) . createLogger ( ) ;
2323
24+ // When sourcing your workspace, CMAKE_PREFIX_PATH is AUTOMATICALLY
25+ // prepended with the devel directory of your workspace. Workspace
26+ // chaining works by continuing this path prepending.
2427let cmakePath = process . env . CMAKE_PREFIX_PATH ;
2528let cmakePaths = cmakePath . split ( ':' ) ;
2629let jsMsgPath = 'share/node_js/ros' ;
@@ -48,8 +51,12 @@ let MessageUtils = {
4851 if ( fs . existsSync ( path_ ) ) {
4952 let msgPackages = fs . readdirSync ( path_ ) ;
5053 msgPackages . forEach ( ( msgPackage ) => {
51- let indexPath = path . join ( path_ , msgPackage , '_index.js' ) ;
52- messagePackagePathMap [ msgPackage ] = indexPath ;
54+ // If the message package has been found in a previous workspace,
55+ // don't overwrite it now. This is critical to enabling ws overlays.
56+ if ( ! messagePackagePathMap . hasOwnProperty ( msgPackage ) ) {
57+ let indexPath = path . join ( path_ , msgPackage , '_index.js' ) ;
58+ messagePackagePathMap [ msgPackage ] = indexPath ;
59+ }
5360 } ) ;
5461 }
5562 } ) ;
You can’t perform that action at this time.
0 commit comments