Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate settings.json file on vscode server workbench #415

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions codeserver/ubi9-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ fi
# Initilize access logs for culling
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/codeserver.access.log

# Directory for settings file
user_dir="/opt/app-root/src/.local/share/code-server/User/"
settings_filepath="${user_dir}settings.json"

json_settings='{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}'

# Check if User directory exists
if [ ! -d "$user_dir" ]; then
echo "Debug: User directory not found, creating '$user_dir'..."
mkdir -p "$user_dir"
echo "$json_settings" > "$settings_filepath"
echo "Debug: '$settings_filepath' file created."
else
echo "Debug: User directory already exists."
# Add settings.json if not present
if [ ! -f "$settings_filepath" ]; then
echo "Debug: '$settings_filepath' file not found, creating..."
echo "$json_settings" > "$settings_filepath"
echo "Debug: '$settings_filepath' file created."
else
echo "Debug: '$settings_filepath' file already exists."
fi
fi

# Check if code-server folder exists
if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then

Expand Down
Loading