You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
646 B
25 lines
646 B
1 year ago
|
#!/bin/sh
|
||
|
|
||
|
install_cd() {
|
||
|
if ! grep -q "alias cd=" ~/.bashrc; then
|
||
|
echo "Do you wish to memorize this spell, so that you look around rooms automatically as you use 'cd'? (yes/no)"
|
||
|
read -r answer
|
||
|
if [ "$answer" = "yes" ]; then
|
||
|
scriptpath="$(dirname $(readlink -f $0))"
|
||
|
filename="$(basename "$0")"
|
||
|
echo "alias cd=\". $scriptpath/$filename\"" >> ~/.bashrc
|
||
|
echo "Spell memorized in .bashrc, so the mud will always be active in the terminal."
|
||
|
else
|
||
|
echo "The mud will only run in this shell window."
|
||
|
fi
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
install_cd
|
||
|
|
||
|
# Call the standard cd command
|
||
|
builtin cd "$@"
|
||
|
|
||
|
# Look around the room
|
||
|
look
|