feat: extract editor used into own env var
Keep the old (and now default) behavior as fallback.
This commit is contained in:
4
agenda
4
agenda
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
AGENDA_EDITOR=${VISUAL:-${EDITOR:-vi}}
|
||||||
|
|
||||||
# The home of all files read and written by agenda.
|
# The home of all files read and written by agenda.
|
||||||
#
|
#
|
||||||
# If this is left empty, this will default to the xdg user DOCUMENTS directory (in a
|
# If this is left empty, this will default to the xdg user DOCUMENTS directory (in a
|
||||||
@@ -169,7 +171,7 @@ __edit() {
|
|||||||
|
|
||||||
if [ "$opt_E" = "no" ]; then
|
if [ "$opt_E" = "no" ]; then
|
||||||
export AGENDA_FILE="$file"
|
export AGENDA_FILE="$file"
|
||||||
exec ${VISUAL:-${EDITOR:-vi}} "$file"
|
exec $AGENDA_EDITOR "$file"
|
||||||
else
|
else
|
||||||
echo "$file"
|
echo "$file"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user