This commit is contained in:
Ken Conley 2012-02-28 20:05:40 +00:00
parent 22c2ba0979
commit b692bf57c0
1 changed files with 11 additions and 3 deletions

View File

@ -124,16 +124,24 @@ function roscd {
return 0
fi
if [ -z $1 ]; then
cd ${ROS_ROOT}
if [ -z $ROS_WORKSPACE ]; then
echo -e "No ROS_WORKSPACE set. Please set ROS_WORKSPACE to use roscd with no arguments."
return 1
fi
cd ${ROS_WORKSPACE}
return 0
fi
_ros_decode_path $1 forceeval
if [ $? != 0 ]; then
echo "roscd: No such package '$1'"
echo "roscd: No such package/stack '$1'"
return 1
elif [ -z $rosvals ]; then
cd ${ROS_ROOT}
if [ -z $ROS_WORKSPACE ]; then
echo -e "No ROS_WORKSPACE set. Please set ROS_WORKSPACE to use roscd with no arguments."
return 1
fi
cd ${ROS_WORKSPACE}
return 0
else
cd ${rosvals[1]}${rosvals[2]}${rosvals[3]}