Skip to content

Commit bc017be

Browse files
committed
Address comments
1 parent b96cfc6 commit bc017be

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/linux-x64-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
# Install any remaining runtime dependencies using rosdep
8181
rosdep init || true
8282
rosdep update
83-
rosdep install --rosdistro rolling --from-paths /opt/ros/rolling/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastdds iceoryx_binding_c rmw_connextdds rti-connext-dds-7.3.0 urdfdom_headers python3-pyqt6.qtsvg rosidl_buffer_py pybind11"
83+
rosdep install --rosdistro rolling --from-paths /opt/ros/rolling/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastdds iceoryx_binding_c rmw_connextdds rti-connext-dds-7.3.0 rti-connext-dds-7.7.0 urdfdom_headers python3-pyqt6.qtsvg rosidl_buffer_py pybind11"
8484
8585
- name: Install test-msgs and mrpt_msgs on Linux
8686
if: ${{ matrix.ros_distribution != 'rolling' }}

lib/distro.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ const DistroUtils = {
4949
* @return {number} Return the rclnodejs distro identifier
5050
*/
5151
getDistroId: function (distroName) {
52-
const dname = distroName ? distroName.toLowerCase() : this.getDistroName();
52+
const dname =
53+
(distroName || this.getDistroName() || '').toLowerCase() || undefined;
5354

54-
if (DistroNameIdMap.has(dname)) {
55+
if (dname && DistroNameIdMap.has(dname)) {
5556
return DistroNameIdMap.get(dname);
5657
}
5758

58-
// Unrecognized but set ROS_DISTRO → assume future distro; unset → unknown
59+
// Unrecognized but provided/resolved distro name → assume future; unset → unknown
5960
return dname ? DistroId.FUTURE : DistroId.UNKNOWN;
6061
},
6162

test/test-distro.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ describe('rclnodejs distro utils', function () {
8080
delete process.env.ROS_DISTRO;
8181
assert.equal(DistroUtils.getDistroId(), DistroUtils.DistroId.UNKNOWN);
8282

83-
process.env.ROS_DISTRO = backupEnvar;
83+
if (backupEnvar !== undefined) {
84+
process.env.ROS_DISTRO = backupEnvar;
85+
}
8486
done();
8587
});
8688

0 commit comments

Comments
 (0)