summaryrefslogtreecommitdiff
path: root/scripts/vic
blob: d6ca7b10f6ad6433404595c52ce7efbb01a7a7e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash

RED="\e[31m" RESET="\e[0m"

cmd=$(which "$1" 2>/dev/null)
editor="${EDITOR:-nvim}"

if [ -z "$cmd" ]; then
  printf '\n%b\n' "${RED}Error${RESET}: command not in path or wrong name."
else
  "$editor" "$cmd" || exit 0
fi