zsh/modules/conf/init
Alexander Gehrke (crater2150) 05f6bf7007 Various small additions
2016-07-22 16:01:35 +02:00

23 lines
386 B
Bash
Executable file

#!/bin/zsh
conf() {
local target=${conf_locations[${1}]}
if [[ -d ${target} ]]; then
cd ${target}
if ! [[ -w ${target} ]]; then
su
fi
elif [[ -f ${target} ]]; then
if ! [[ -w ${target} ]]; then
sudoedit ${target}
else
$EDITOR ${target}
fi
elif [[ -n ${target} ]]; then
echo "Conf target for $1 missing: $target"
else
echo "Unknown conf target: $1"
fi
}