Improve scripts
This commit is contained in:
parent
f94f6a1c60
commit
b5764c0376
8 changed files with 28 additions and 16 deletions
6
.bin/.e
6
.bin/.e
|
@ -19,19 +19,19 @@ declare -A mapper=(
|
|||
["zsh"]="$HOME/.config/zsh/.zshrc"
|
||||
)
|
||||
|
||||
if [[ -z "$1" ]]
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "No argument given. Use --list (-l) to show all options."
|
||||
exit
|
||||
fi
|
||||
if [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]]
|
||||
if [ "$1" = "-l" ] || [ "$1" = "--list" ]
|
||||
then
|
||||
echo "${!mapper[@]}"
|
||||
exit
|
||||
fi
|
||||
|
||||
target="${mapper["$1"]}"
|
||||
if [[ -n "$target" ]]
|
||||
if [ -n "$target" ]
|
||||
then
|
||||
$EDITOR "$target"
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue