parent
8839bd4595
commit
29cc392dff
25
abra
25
abra
@ -684,6 +684,31 @@ sub_app_undeploy (){
|
|||||||
sub_app_config (){
|
sub_app_config (){
|
||||||
load_instance
|
load_instance
|
||||||
|
|
||||||
|
if [ -z "$EDITOR" ]; then
|
||||||
|
warning "\$EDITOR not set; which text editor would you like to use?"
|
||||||
|
|
||||||
|
EDITORS_ALL=(vi vim nano pico emacs)
|
||||||
|
declare -a EDITORS_AVAILABLE
|
||||||
|
|
||||||
|
for EDITOR in "${EDITORS_ALL[@]}"; do
|
||||||
|
if type "$EDITOR" > /dev/null 2>&1; then
|
||||||
|
EDITORS_AVAILABLE+=("$EDITOR")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#EDITORS_AVAILABLE[@]} = 0 ]; then
|
||||||
|
error "No text editors found! Are you using a magnetised needle? 🤪"
|
||||||
|
fi
|
||||||
|
|
||||||
|
select EDITOR in "${EDITORS_AVAILABLE[@]}"; do
|
||||||
|
if [ 1 -le "$REPLY" ] && [ "$REPLY" -le ${#EDITORS_AVAILABLE[@]} ]; then
|
||||||
|
SERVER="$EDITOR"
|
||||||
|
success "Using '${EDITOR}'; Add 'export EDITOR=${EDITOR}' to your ~/.bashrc to set as default"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
$EDITOR "$ENV_FILE"
|
$EDITOR "$ENV_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user