uci-docker-doc/src/rootfs/opt/services/editor/run

15 lines
493 B
Bash
Executable File

#!/bin/bash
env | grep EDITOR
echo booting up editor
ls -la $DOC_HOME/editor
if [[ -f $EDITOR_CONFIG_TMPL ]]; then
echo creating editor config from template
envsubst < $EDITOR_CONFIG_TMPL > $EDITOR_CONFIG
fi
[[ ! -f $EDITOR_CONFIG ]] && echo "no editor config file (or template) at $EDITOR_CONFIG, aborting" && exit 1
echo "--- editor config -----"
cat $EDITOR_CONFIG
echo "-----------------------"
echo starting code server editor
sudo -u doc $EDITOR_BIN --config $EDITOR_CONFIG $@ $DOC_HOME