Skip to content

Commit

Permalink
Improve tsd generation resilency.
Browse files Browse the repository at this point in the history
rostsd_gen/index.js
- support service idl defined in any folder starting with 'srv', e.g.,
'srvs'
-  support action idl defined in any folder starting with 'action',
e.g., 'actions'

Fix #688
  • Loading branch information
wayneparrott authored and Minggang Wang committed Aug 4, 2020
1 parent 67bec1e commit 9523d21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rostsd_gen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getPkgInfos(generatedRoot) {
for (let filename of files) {
const typeClass = fileName2Typeclass(filename);

if (typeClass.type === 'srv') {
if (typeClass.type && typeClass.type.startsWith('srv')) {
// skip __srv__<action>
if (
!typeClass.name.endsWith('_Request') &&
Expand All @@ -90,7 +90,7 @@ function getPkgInfos(generatedRoot) {
def: def,
};

if (typeClass.type === 'action') {
if (typeClass.type && typeClass.type.startsWith('action')) {
pkgInfo.actions.push(msgInfo);
} else {
pkgInfo.messages.push(msgInfo);
Expand Down

0 comments on commit 9523d21

Please sign in to comment.