summarylogtreecommitdiffstats
path: root/patch.sh
blob: 14075a1e50928ade5a0e3b715048dcaf5d68ebbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env sh

if [ "${1}" = "-R" ]; then
    sed -i -e 's/^[[:blank:]]*"nameLong":.*/  "nameLong": "VSCodium",/' \
        -e 's/^[[:blank:]]*"extensionAllowedProposedApi":.*/  "extensionAllowedProposedApi": ["ms-vscode.vscode-js-profile-flame", "ms-vscode.vscode-js-profile-table", "ms-vscode.github-browser", "ms-vscode.github-richnav", "ms-vscode.remotehub", "ms-vscode.remotehub-insiders", "ms-vsliveshare.vsliveshare", "ms-vscode-remote.remote-ssh", "ms-vscode.cpptools", "ms-azuretools.vscode-docker", "visualstudioexptteam.vscodeintellicode", "ms-python.python"],/' \
        -e '/^[[:blank:]]*"extensionSyncedKeys/d' \
        -e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \
        -e '/^[[:blank:]]*"serverDataFolderName/i\  "linkProtectionTrustedDomains": ["https://open-vsx.org"],' \
        /usr/share/vscodium/resources/app/product.json
else
    sed -i -e 's/^[[:blank:]]*"nameLong":.*/  "nameLong": "Visual Studio Code",/' \
        -e 's/^[[:blank:]]*"extensionAllowedProposedApi":.*/  "extensionAllowedProposedApi": ["GitHub.codespaces", "GitHub.vscode-pull-request-github-insiders", "GitHub.vscode-pull-request-github", "Microsoft.vscode-nmake-tools", "ms-ai-tools.notebook-renderers", "ms-dotnettools.dotnet-interactive-vscode", "ms-python.gather", "ms-python.python", "ms-toolsai.jupyter", "ms-toolsai.vscode-ai", "ms-toolsai.vscode-ai-remote", "ms-vscode-remote.remote-containers-nightly", "ms-vscode-remote.remote-containers", "ms-vscode-remote.remote-ssh-edit-nightly", "ms-vscode-remote.remote-ssh-edit", "ms-vscode-remote.remote-ssh-nightly", "ms-vscode-remote.remote-ssh", "ms-vscode-remote.remote-wsl-nightly", "ms-vscode-remote.remote-wsl", "ms-vscode-remote.remote-wsl-recommender", "ms-vscode-remote.vscode-remote-extensionpack-nightly", "ms-vscode-remote.vscode-remote-extensionpack", "ms-vscode.azure-account", "ms-vscode.azure-sphere-tools-ui", "ms-vscode.azure-sphere-tools", "ms-vscode.github-browser", "ms-vscode.github-richnav", "ms-vscode.js-debug-nightly", "ms-vscode.js-debug", "ms-vscode.lsif-browser", "ms-vscode.vscode-js-profile-flame", "ms-vscode.vscode-js-profile-table", "ms-vscode.vscode-selfhost-test-provider", "ms-vsliveshare.cloudenv-explorer", "ms-vsliveshare.cloudenv", "ms-vsliveshare.vsliveshare", "ms-vsonline.vsonline", "dbaeumer.vscode-eslint"],/' \
        -e '/^[[:blank:]]*"extensionSyncedKeys/d' \
        -e '/^[[:blank:]]*"extensionAllowedProposedApi/a\  "extensionSyncedKeys": { "ritwickdey.liveserver": ["liveServer.setup.version"] }, "linkProtectionTrustedDomains": ["https:\/\/*.visualstudio.com", "https:\/\/*.microsoft.com", "https:\/\/aka.ms", "https:\/\/vscode-auth.github.com", "https:\/\/*.gallerycdn.vsassets.io", "https:\/\/github.com\/microsoft\/", "https:\/\/github.com\/MicrosoftDocs\/", "https:\/\/login.microsoftonline.com"], "auth": { "loginUrl": "https:\/\/login.microsoftonline.com\/common\/oauth2\/authorize", "tokenUrl": "https:\/\/login.microsoftonline.com\/common\/oauth2\/token", "redirectUrl": "https:\/\/vscode-redirect.azurewebsites.net\/", "clientId": "aebc6443-996d-45c2-90f0-388ff96faa56" }, "configurationSync.store": { "url": "https:\/\/vscode-sync.trafficmanager.net\/", "stableUrl": "https:\/\/vscode-sync.trafficmanager.net\/", "insidersUrl": "https:\/\/vscode-sync-insiders.trafficmanager.net\/", "canSwitch": false, "authenticationProviders": { "microsoft": { "scopes": ["https:\/\/management.core.windows.net\/.default", "offline_access"] }, "github": { "scopes": ["user:email"] } } },' \
        -e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \
        /usr/share/vscodium/resources/app/product.json
fi