Various small additions
This commit is contained in:
parent
fe3c0fb5d5
commit
05f6bf7007
11 changed files with 208 additions and 5 deletions
22
modules/conf/init
Executable file
22
modules/conf/init
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/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
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue