From: Samir Benmendil Date: Sat, 8 Feb 2014 06:46:02 +0000 (+0100) Subject: zsh: move ros initialisation to its own function X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/6edb558f9c43fa934e4e418294bc652f5a34cf28?ds=sidebyside zsh: move ros initialisation to its own function --- diff --git a/zsh/functions/rosinit b/zsh/functions/rosinit new file mode 100644 index 0000000..245cd3f --- /dev/null +++ b/zsh/functions/rosinit @@ -0,0 +1,15 @@ +#!/bin/zsh + +function rosinit() { + local ROS_DISTRO=hydro + local WORKSPACE=~/src/ros + if [[ -f "/opt/ros/$ROS_DISTRO/setup.zsh" ]]; then + export ROS_OS_OVERRIDE=arch + source /opt/ros/$ROS_DISTRO/setup.zsh + source $WORKSPACE/devel/setup.zsh + export ROS_WORKSPACE=$WORKSPACE + roscd + else + echo "ROS $ROS_DISTRO doesn't seem to be installed." >&2 + fi +} diff --git a/zshrc b/zshrc index cf7be9b..2d8463f 100644 --- a/zshrc +++ b/zshrc @@ -67,8 +67,3 @@ hash -d UniMaas=~/dropbox/Documents/UniMaas # set some env variables export _gamedir=/mnt/Skaro/Games/Linux/HumbleBundle -# ros -if [[ -f "/opt/ros/groovy/setup.zsh" ]]; then - export ROS_WORKSPACE=~/src/ros - export ROS_OS_OVERRIDE=arch -fi