forked from supabase/edge-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate
code-server
with the container image
- Loading branch information
1 parent
a5fee1d
commit ac547af
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
export PS1='\w $ ' | ||
|
||
EXTENSIONS="${CODE_SERVER_EXTENSIONS:-none}" | ||
|
||
if [ -z "$USE_CODE_SERVER_INTEGRATION" ]; then | ||
edge-runtime $@ & | ||
else | ||
mkdir -p /root/.local/share/code-server/User | ||
cat > /root/.local/share/code-server/User/settings.json << EOF | ||
{ | ||
"workbench.colorTheme": "Visual Studio Dark", | ||
"deno.enable": true | ||
} | ||
EOF | ||
|
||
if [ ${EXTENSIONS} != "none" ]; then | ||
echo "Installing Extensions" | ||
for extension in $(echo ${EXTENSIONS} | tr "," "\n") | ||
do | ||
if [ "${extension}" != "" ]; then | ||
/usr/bin/code-server \ | ||
--install-extension "${extension}" \ | ||
/home/deno/functions | ||
fi | ||
done | ||
fi | ||
|
||
(/usr/bin/code-server \ | ||
--bind-addr "${CODE_SERVER_HOST}":"${CODE_SERVER_PORT}" \ | ||
--auth none \ | ||
/home/deno/functions \ | ||
) & | ||
|
||
edge-runtime $@ & | ||
fi | ||
|
||
wait -n |