Ensure EDITOR is exported for non-uwsm envs too
Like SSH'ing into an Omarchy machine
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Editor used by CLI
|
||||
export EDITOR="${EDITOR:-omarchy-launch-editor --inline}"
|
||||
export SUDO_EDITOR="$EDITOR"
|
||||
export BAT_THEME=ansi
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source "$(dirname "$0")/base-test.sh"
|
||||
|
||||
envs="$ROOT/default/bash/envs"
|
||||
|
||||
editor=$(env -u EDITOR bash -c 'source "$1"; printf "%s" "$EDITOR"' bash "$envs")
|
||||
[[ $editor == "omarchy-launch-editor --inline" ]] || fail "bash env provides a default editor" "actual: $editor"
|
||||
pass "bash env provides a default editor"
|
||||
|
||||
editor=$(EDITOR=helix bash -c 'source "$1"; printf "%s" "$EDITOR"' bash "$envs")
|
||||
[[ $editor == "helix" ]] || fail "bash env preserves the inherited editor" "actual: $editor"
|
||||
pass "bash env preserves the inherited editor"
|
||||
|
||||
sudo_editor=$(env -u EDITOR -u SUDO_EDITOR bash -c 'source "$1"; printf "%s" "$SUDO_EDITOR"' bash "$envs")
|
||||
[[ $sudo_editor == "omarchy-launch-editor --inline" ]] || fail "sudo uses the default editor" "actual: $sudo_editor"
|
||||
pass "sudo uses the default editor"
|
||||
Reference in New Issue
Block a user