Skip to content

Commit 8bde77d

Browse files
Patch subfolder regex to support hyphens
1 parent 70cfe1f commit 8bde77d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rosidl_gen/packages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function getPackageName(filePath, amentExecuted) {
3333
}
3434

3535
if (amentExecuted) {
36-
return filePath.match(/\w+\/share\/(\w+)\//)[1];
36+
return filePath.match(/[^/]+\/share\/([^/]+)\//)[1];
3737
}
3838

3939
let folders = path.parse(filePath).dir.split('/');
@@ -52,7 +52,7 @@ function getSubFolder(filePath, amentExecuted) {
5252
}
5353

5454
if (amentExecuted) {
55-
return filePath.match(/\w+\/share\/\w+\/(\w+)\//)[1];
55+
return filePath.match(/[^/]+\/share\/[^/]+\/([^/]+)\//)[1];
5656
}
5757
// If the |amentExecuted| equals to false, the file's extension will be assigned as
5858
// the name of sub folder.

0 commit comments

Comments
 (0)