feat: allow for first launch to download code-server

pull/184/head
Michael Brewer 1 year ago committed by GitHub
parent dc00049030
commit 9b4e400cae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,6 +6,12 @@ CODE='\033[36;40;1m'
RESET='\033[0m' RESET='\033[0m'
CODE_SERVER="${INSTALL_PREFIX}/bin/code-server" CODE_SERVER="${INSTALL_PREFIX}/bin/code-server"
function run_code_server() {
echo "👷 Running code-server in the background..."
echo "Check logs at ${LOG_PATH}!"
$CODE_SERVER --auth none --port ${PORT} --app-name "${APP_NAME}" > ${LOG_PATH} 2>&1 &
}
# Check if the settings file exists... # Check if the settings file exists...
if [ ! -f ~/.local/share/code-server/User/settings.json ]; then if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
echo "⚙️ Creating settings file..." echo "⚙️ Creating settings file..."
@ -13,9 +19,9 @@ if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json
fi fi
if [ "${OFFLINE}" = true ]; then if [ "${OFFLINE}" = true ] && [ -f $CODE_SERVER ]; then
echo "👷 Running code-server in offline mode..." echo "🥳 Found offline copy of code-server"
$CODE_SERVER --auth none --port ${PORT} --app-name "${APP_NAME}" > ${LOG_PATH} 2>&1 & run_code_server
exit 0 exit 0
fi fi
@ -50,6 +56,4 @@ for extension in "$${EXTENSIONLIST[@]}"; do
fi fi
done done
echo "👷 Running code-server in the background..." run_code_server
echo "Check logs at ${LOG_PATH}!"
$CODE_SERVER --auth none --port ${PORT} --app-name "${APP_NAME}" > ${LOG_PATH} 2>&1 &

Loading…
Cancel
Save