Skip to content

vscode-web module: settings not applied #447

@anasfanani

Description

@anasfanani

When there already

cat ~/.vscode-server/data/Machine/settings.json
{
"git.useIntegratedAskPass": false,
"github.gitAuthentication": false
}

This script fail

https://github.com/coder/registry/blob/2de6a57a3f06381e490612073a77621f98abee04/registry/coder/modules/vscode-web/run.sh#L32C1-L36C4

What a best fix approach, is using jq to merge good idea ?

eg:

# Merge settings
echo "⚙️ Updating VS Code settings..."
mkdir -p ~/.vscode-server/data/Machine

SETTINGS_FILE=~/.vscode-server/data/Machine/settings.json

if [ -f "$SETTINGS_FILE" ]; then
  TEMP_FILE=$(mktemp)
  jq -s '.[0] * .[1]' "$SETTINGS_FILE" <(echo "${SETTINGS}") > "$TEMP_FILE"
  mv "$TEMP_FILE" "$SETTINGS_FILE"
else
  echo "${SETTINGS}" > "$SETTINGS_FILE"
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions