-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.envrc
21 lines (19 loc) · 986 Bytes
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export_alias() {
local name=$1
shift
local alias_dir=$PWD/.direnv/aliases
local target="$alias_dir/$name"
local oldpath="$PATH"
mkdir -p "$alias_dir"
if ! [[ ":$PATH:" == *":$alias_dir:"* ]]; then
PATH_add "$alias_dir"
fi
echo "#!/usr/bin/env bash" > "$target"
echo "PATH=\"$oldpath\"" >> "$target"
echo "$@" >> "$target"
chmod +x "$target"
}
export_alias roscreate "docker run --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 -e DISPLAY=$DISPLAY -e LOCAL_UID=$(id -u $USER) -e LOCAL_GID=$(id -g $USER) -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/bus/usb:/dev/bus/usb --mount type=bind,source=$(pwd),destination=/workspace -it osrf/ros:noetic-desktop-full"
export_alias rosstart "docker start $(docker ps -aqf "ancestor=osrf/ros:noetic-desktop-full")"
export_alias rosopen "docker exec -it $(docker ps -aqf "ancestor=osrf/ros:noetic-desktop-full") /bin/bash"
export_alias rosstop "docker stop $(docker ps -aqf "ancestor=osrf/ros:noetic-desktop-full")"