Compare commits

..

20 Commits

Author SHA1 Message Date
Baptiste Augrain
9c2f61b79c fix: report issue to vscodium (#825) 2021-09-07 01:56:10 +02:00
Baptiste Augrain
0d433893b7 use github personal access token (#672) 2021-09-06 15:22:30 +02:00
Baptiste Augrain
bf524a9c2c fix(1.60): add patch to disable CORS (#822) 2021-09-06 12:01:31 +02:00
Baptiste Augrain
d862b86a27 fix(1.60): update custom gallery patch (#817) 2021-09-02 22:34:19 +02:00
Baptiste Augrain
8aa9de17b1 fix: rewrite tag search for linux arm (#809) 2021-08-27 23:40:30 +02:00
Baptiste Augrain
72363757b3 build: push event are detected to avoid premature deployment (#808) 2021-08-27 18:26:59 +02:00
Baptiste Augrain
96332714ae build: specify vscode version to build (#807) 2021-08-27 16:01:17 +02:00
Baptiste Augrain
a5506b975c add some small improvements (#803) 2021-08-23 05:05:01 +02:00
Baptiste Augrain
b175fd43eb fix: fail build when a patch can't be applied (#797) 2021-08-14 22:59:32 +02:00
Baptiste Augrain
b1970e82af do not start crashReporter when appCenter isn't configured (#787) 2021-08-06 01:49:57 +02:00
Baptiste Augrain
23160ad483 Disable cors (#774) 2021-08-03 18:51:40 +02:00
swinder0161
51ee66e019 Add support to build insider latest build: $ INSIDER=1 ./build/build_mac.sh (#784) 2021-08-03 14:43:49 +02:00
descodess
2abbfed911 fix typo in README.md (#785) 2021-08-03 14:42:23 +02:00
Baptiste Augrain
8187c7fd7f add a loop to apply patches (#779) 2021-07-29 12:31:54 +02:00
Baptiste Augrain
53b071366b Fix AppImage's dependency (#775)
* move dependency installation into workflow

* dependency install not needed
2021-07-26 01:15:55 +02:00
Baptiste Augrain
98372f9d1e Fixing python in AppImage (#773)
- overwrite AppRun to remove the env variables `PYTHONHOME` and `PYTHONPATH`
- update building script to it can be build manually in docker
2021-07-23 10:01:38 +02:00
Baptiste Augrain
30313a518b Update doc (#772)
* add missing dependencies for linux
* update node version
2021-07-23 09:48:52 +02:00
Michael Kirsch
2ecbd09c2b update icon paths (#440) 2021-07-22 16:43:39 -07:00
swinder0161
66551077f8 Add support to use GNU sed installed in mac osx (#770)
* Add support to use GNU sed installed in mac osx

* Move common functions to utils.sh

Co-authored-by: Swinder Pal Singh Juneja <swinder.juneja@oneplus.com>
2021-07-21 22:49:00 +02:00
Liwen Guo
e1b4583cf9 Use applicationName for update cache path (#765) 2021-07-16 16:37:07 -07:00
26 changed files with 665 additions and 90 deletions

View File

@@ -83,7 +83,7 @@ jobs:
- name: Zip release - name: Zip release
run: | run: |
cd VSCode-linux-${VSCODE_ARCH} cd VSCode-linux-${VSCODE_ARCH}
tar czf ../VSCodium-linux-${VSCODE_ARCH}-${LATEST_MS_TAG}.tar.gz . tar czf ../VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz .
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Generate shasums - name: Generate shasums
@@ -94,7 +94,7 @@ jobs:
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with: with:
tag_name: ${{ env.LATEST_MS_TAG }} tag_name: ${{ env.MS_TAG }}
files: | files: |
./*.sha256 ./*.sha256
./*.zip ./*.zip

View File

@@ -84,14 +84,14 @@ jobs:
- name: Zip release - name: Zip release
run: | run: |
cd "VSCode-darwin-${VSCODE_ARCH}" cd "VSCode-darwin-${VSCODE_ARCH}"
zip -r -X -y ../VSCodium-darwin-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip ./*.app zip -r -X -y ../VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip ./*.app
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: DMG the release - name: DMG the release
run: | run: |
pushd "VSCode-darwin-${VSCODE_ARCH}" pushd "VSCode-darwin-${VSCODE_ARCH}"
npx create-dmg VSCodium.app .. npx create-dmg VSCodium.app ..
mv "../VSCodium ${LATEST_MS_TAG}.dmg" "../VSCodium.${VSCODE_ARCH}.${LATEST_MS_TAG}.dmg" mv "../VSCodium ${MS_TAG}.dmg" "../VSCodium.${VSCODE_ARCH}.${MS_TAG}.dmg"
popd popd
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
@@ -103,7 +103,7 @@ jobs:
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with: with:
tag_name: ${{ env.LATEST_MS_TAG }} tag_name: ${{ env.MS_TAG }}
files: | files: |
./*.zip ./*.zip
./*.dmg ./*.dmg

View File

@@ -79,9 +79,9 @@ jobs:
- name: Move/rename build artifacts - name: Move/rename build artifacts
run: | run: |
mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe VSCodiumSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip VSCodium-win32-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip
shell: bash shell: bash
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
@@ -94,7 +94,7 @@ jobs:
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with: with:
tag_name: ${{ env.LATEST_MS_TAG }} tag_name: ${{ env.MS_TAG }}
files: | files: |
./*.sha256 ./*.sha256
./VSCodium*.zip ./VSCodium*.zip

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
vscode vscode
VS*/* VS*/*
.DS_Store .DS_Store
out
pkg2appimage-*.AppImage
pkg2appimage.AppDir

11
DOCS.md
View File

@@ -9,6 +9,7 @@
- [Proprietary Debugging Tools](#proprietary-debugging-tools) - [Proprietary Debugging Tools](#proprietary-debugging-tools)
- [Proprietary Extensions](#proprietary-extensions) - [Proprietary Extensions](#proprietary-extensions)
- [Migrating from Visual Studio Code to VSCodium](#migrating) - [Migrating from Visual Studio Code to VSCodium](#migrating)
- [Sign in with GitHub](#signin-github)
- [How do I run VSCodium in portable mode?](#portable) - [How do I run VSCodium in portable mode?](#portable)
- [How do I press and hold a key and have it repeat in VSCodium?](#press-and-hold) - [How do I press and hold a key and have it repeat in VSCodium?](#press-and-hold)
- [How do I open VSCodium from the terminal?](#terminal-support) - [How do I open VSCodium from the terminal?](#terminal-support)
@@ -122,6 +123,16 @@ To copy your settings manually:
- Click the three dots `...` and choose 'Open settings.json' - Click the three dots `...` and choose 'Open settings.json'
- Copy the contents of settings.json into the same place in VSCodium - Copy the contents of settings.json into the same place in VSCodium
## <a id="signin-github"></a>Sign in with GitHub
In VSCodium, `Sign in with GitHub` is using a Personal Access Token.<br />
Follow the documentation https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token to create your token.<br />
Select the scopes dependending of the extension which need access to GitHub. (GitLens requires the `repo` scope.)
### Linux
If you are getting the error `Writing login information to the keychain failed with error 'The name org.freedesktop.secrets was not provided by any .service files'.`, you need to install the package `gnome-keyring`.
## <a id="portable"></a>How do I run VSCodium in portable mode? ## <a id="portable"></a>How do I run VSCodium in portable mode?
You can follow the [Portable Mode instructions](https://code.visualstudio.com/docs/editor/portable) from the Visual Studio Code website. You can follow the [Portable Mode instructions](https://code.visualstudio.com/docs/editor/portable) from the Visual Studio Code website.
- **Windows** / **Linux** : the instructions can be followed as written. - **Windows** / **Linux** : the instructions can be followed as written.

View File

@@ -118,7 +118,7 @@ According to the VS Code Marketplace [Terms of Use](https://aka.ms/vsmarketplace
Please note that some Visual Studio Code extensions have licenses that restrict their use to the official Visual Studio Code builds and therefore do not work with VSCodium. See [this note](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#proprietary-debugging-tools) on the Docs page for what's been found so far and possible workarounds. Please note that some Visual Studio Code extensions have licenses that restrict their use to the official Visual Studio Code builds and therefore do not work with VSCodium. See [this note](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#proprietary-debugging-tools) on the Docs page for what's been found so far and possible workarounds.
### How are the VSCodium binaries built? ### How are the VSCodium binaries built?
If you would like to see the commands we run to build `vscode` into VSCodium binaries, have a look at the workflow files in `.github/workflow` for Windows, GNU/Linux and macOS. These build files call all the other scripts in the repo. If you find something that doesn't make sense, feel free to ask about it [on Gitter](https://gitter.im/VSCodium/Lobby). If you would like to see the commands we run to build `vscode` into VSCodium binaries, have a look at the workflow files in `.github/workflows` for Windows, GNU/Linux and macOS. These build files call all the other scripts in the repo. If you find something that doesn't make sense, feel free to ask about it [on Gitter](https://gitter.im/VSCodium/Lobby).
The builds are run every day, but exit early if there isn't a new release from Microsoft. The builds are run every day, but exit early if there isn't a new release from Microsoft.

View File

@@ -30,3 +30,15 @@ script:
- /usr/bin/convert vscodium.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/vscodium.png - /usr/bin/convert vscodium.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/vscodium.png
- /usr/bin/convert vscodium.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/vscodium.png - /usr/bin/convert vscodium.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/vscodium.png
- ( cd usr/bin/ ; ln -s ../share/codium/codium . ) - ( cd usr/bin/ ; ln -s ../share/codium/codium . )
- cat > AppRun <<\EOF
- #!/bin/sh
- HERE="$(dirname "$(readlink -f "${0}")")"
- export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
- export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
- export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
- export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}"
- export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
- export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}"
- EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g')
- exec ${EXEC} "$@"
- EOF

View File

@@ -5,7 +5,7 @@ set -ex
if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$SHOULD_BUILD" == "yes" ]]; then
npm config set scripts-prepend-node-path true npm config set scripts-prepend-node-path true
echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}" echo "MS_COMMIT: ${MS_COMMIT}"
. prepare_vscode.sh . prepare_vscode.sh

View File

@@ -1,6 +1,7 @@
# powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1 # powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1
$env:Path += ";C:\Program Files\Git\bin" # first so `bash` is the one installed with `git`, avoid conflict with WSL
$env:Path = "C:\Program Files\Git\bin;" + $env:Path
Remove-Item -Recurse -Force VSCode* Remove-Item -Recurse -Force VSCode*

10
build/build_windows.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# to run with WSL: wsl ./build/build_windows.sh
rm -rf VSCode*
rm -rf vscode
./get_repo.sh
SHOULD_BUILD=yes CI_BUILD=no OS_NAME=windows VSCODE_ARCH=x64 ./build.sh

View File

@@ -5,6 +5,11 @@ set -e
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
echo "It's a PR" echo "It's a PR"
export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ $GITHUB_EVENT_NAME == "push" ]]; then
echo "It's a Push"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no" export SHOULD_DEPLOY="no"
else else

View File

@@ -3,23 +3,23 @@
set -e set -e
REPOSITORY=${GITHUB_REPOSITORY:-"VSCodium/vscodium"} REPOSITORY=${GITHUB_REPOSITORY:-"VSCodium/vscodium"}
GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$LATEST_MS_TAG) GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$MS_TAG)
VSCODIUM_ASSETS=$(echo $GITHUB_RESPONSE | jq '.assets') VSCODIUM_ASSETS=$(echo $GITHUB_RESPONSE | jq '.assets')
# if we just don't have the github token, get out fast # if we just don't have the github token, get out fast
if [ "$GITHUB_TOKEN" != "" ]; then if [ "$GITHUB_TOKEN" != "" ]; then
if [ "$VSCODIUM_ASSETS" != "null" ]; then if [ "$VSCODIUM_ASSETS" != "null" ]; then
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
HAVE_MAC=$(echo $VSCODIUM_ASSETS | jq --arg suffix "darwin-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])') HAVE_MAC=$(echo $VSCODIUM_ASSETS | jq --arg suffix "darwin-$VSCODE_ARCH-$MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_MAC" != "true" ]]; then if [[ "$HAVE_MAC" != "true" ]]; then
echo "Building on Mac because we have no ZIP" echo "Building on Mac because we have no ZIP"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi fi
elif [[ "$OS_NAME" == "windows" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then if [[ $VSCODE_ARCH == "arm64" ]]; then
HAVE_ARM64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_ARM64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_ARM64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])') HAVE_ARM64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM64_SYS" != "true" ]]; then if [[ "$HAVE_ARM64_SYS" != "true" ]]; then
echo "Building on Windows arm64 because we have no system setup" echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
@@ -36,9 +36,9 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Already have all the Windows arm64 builds" echo "Already have all the Windows arm64 builds"
fi fi
elif [[ $VSCODE_ARCH == "ia32" ]]; then elif [[ $VSCODE_ARCH == "ia32" ]]; then
HAVE_IA32_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_IA32_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_IA32_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])') HAVE_IA32_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_IA32_SYS" != "true" ]]; then if [[ "$HAVE_IA32_SYS" != "true" ]]; then
echo "Building on Windows ia32 because we have no system setup" echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
@@ -55,9 +55,9 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Already have all the Windows ia32 builds" echo "Already have all the Windows ia32 builds"
fi fi
else # Windows x64 else # Windows x64
HAVE_X64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_X64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])') HAVE_X64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])') HAVE_X64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_X64_SYS" != "true" ]]; then if [[ "$HAVE_X64_SYS" != "true" ]]; then
echo "Building on Windows x64 because we have no system setup" echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
@@ -77,7 +77,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
elif [[ "$OS_NAME" == "linux" ]]; then elif [[ "$OS_NAME" == "linux" ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then if [[ $VSCODE_ARCH == "arm64" ]]; then
HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])') HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])')
HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM64_DEB" != "true" ]]; then if [[ "$HAVE_ARM64_DEB" != "true" ]]; then
echo "Building on Linux arm64 because we have no DEB" echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
@@ -91,7 +91,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
fi fi
elif [[ $VSCODE_ARCH == "armhf" ]]; then elif [[ $VSCODE_ARCH == "armhf" ]]; then
HAVE_ARM_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["armhf.deb"])') HAVE_ARM_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["armhf.deb"])')
HAVE_ARM_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "armhf-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') HAVE_ARM_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "armhf-$MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM_DEB" != "true" ]]; then if [[ "$HAVE_ARM_DEB" != "true" ]]; then
echo "Building on Linux arm because we have no DEB" echo "Building on Linux arm because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
@@ -106,7 +106,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
else # Linux x64 else # Linux x64
HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])') HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])')
HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])') HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])')
HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_64_RPM" != "true" ]]; then if [[ "$HAVE_64_RPM" != "true" ]]; then
echo "Building on Linux x64 because we have no RPM" echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"

View File

@@ -3,16 +3,17 @@
cd .. cd ..
if [[ "$VSCODE_ARCH" == "x64" ]]; then if [[ "$VSCODE_ARCH" == "x64" ]]; then
# install a dep needed for this process
sudo apt-get install desktop-file-utils
wget -c https://github.com/$(wget -q https://github.com/AppImage/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) wget -c https://github.com/$(wget -q https://github.com/AppImage/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
chmod +x ./pkg2appimage-*.AppImage chmod +x ./pkg2appimage-*.AppImage
./pkg2appimage-*.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir ./pkg2appimage-*.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir
# add update's url
sed -i 's/generate_type2_appimage/generate_type2_appimage -u "gh-releases-zsync|VSCodium|vscodium|latest|*.AppImage.zsync"/' pkg2appimage.AppDir/AppRun sed -i 's/generate_type2_appimage/generate_type2_appimage -u "gh-releases-zsync|VSCodium|vscodium|latest|*.AppImage.zsync"/' pkg2appimage.AppDir/AppRun
# remove check so build in docker can succeed
sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh
bash -ex pkg2appimage.AppDir/AppRun VSCodium-AppImage-Recipe.yml bash -ex pkg2appimage.AppDir/AppRun VSCodium-AppImage-Recipe.yml
fi fi

View File

@@ -11,9 +11,10 @@
## <a id="dependencies"></a>Dependencies ## <a id="dependencies"></a>Dependencies
- node 12 - node 14
- yarn - yarn
- jq - jq
- git
### <a id="dependencies-linux"></a>Linux ### <a id="dependencies-linux"></a>Linux
@@ -22,13 +23,14 @@
- libsecret-1-dev - libsecret-1-dev
- fakeroot - fakeroot
- rpm - rpm
- rpmbuild
- dpkg
### <a id="dependencies-macos"></a>MacOS ### <a id="dependencies-macos"></a>MacOS
### <a id="dependencies-windows"></a>Windows ### <a id="dependencies-windows"></a>Windows
- powershell - powershell
- git
- sed - sed
## <a id="build-scripts"></a>Build Scripts ## <a id="build-scripts"></a>Build Scripts
@@ -36,7 +38,7 @@
Each platform has its build helper script in the directory `build`. Each platform has its build helper script in the directory `build`.
- Linux: `./build/build_linux.sh` - Linux: `./build/build_linux.sh`
- MacOS: `./build/build_macos_.sh` - MacOS: `./build/build_macos.sh`
- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1` - Windows: `powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1`
## <a id="build-docker"></a>Build in Docker ## <a id="build-docker"></a>Build in Docker
@@ -50,8 +52,8 @@ docker run -ti --volume=<local vscodium source>:/root/vscodium --name=vscodium-b
When inside the container, you can use the following commands to build: When inside the container, you can use the following commands to build:
``` ```
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash - curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs sudo apt-get install -y nodejs desktop-file-utils
npm install -g yarn npm install -g yarn

View File

@@ -1,15 +1,44 @@
#!/bin/bash #!/bin/bash
# figure out latest tag by calling MS update API mkdir -p vscode
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol) cd vscode
export LATEST_MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
export LATEST_MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
echo "Got the latest MS tag: ${LATEST_MS_TAG}"
git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1 git init -q
git remote add origin https://github.com/Microsoft/vscode.git
# figure out latest tag by calling MS update API
if [ "$INSIDER" == "1" ]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/insider/lol)
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
elif [[ -z "${MS_TAG}" ]]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
else
reference=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
if [[ -z "${reference}" ]]; then
echo "The following tag can't be found: ${MS_TAG}"
exit 1
elif [[ "${reference}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
export MS_COMMIT="${BASH_REMATCH[1]}"
export MS_TAG="${BASH_REMATCH[2]}"
else
echo "The following reference can't be parsed: ${reference}"
exit 1
fi
fi
echo "Got the MS tag: ${MS_TAG} version: ${MS_COMMIT}"
git fetch --depth 1 origin $MS_COMMIT
git checkout FETCH_HEAD
cd ..
# for GH actions # for GH actions
if [[ $GITHUB_ENV ]]; then if [[ $GITHUB_ENV ]]; then
echo "LATEST_MS_COMMIT=$LATEST_MS_COMMIT" >> $GITHUB_ENV echo "MS_TAG=$MS_TAG" >> $GITHUB_ENV
echo "LATEST_MS_TAG=$LATEST_MS_TAG" >> $GITHUB_ENV echo "MS_COMMIT=$MS_COMMIT" >> $GITHUB_ENV
fi fi

View File

@@ -0,0 +1,13 @@
diff --git a/src/main.js b/src/main.js
index 19dde20..d9611f2 100644
--- a/src/main.js
+++ b/src/main.js
@@ -409,6 +409,8 @@ function configureCrashReporter() {
argv.splice(endOfArgsMarkerIndex, 0, '--crash-reporter-id', crashReporterId);
}
}
+ } else {
+ return;
}
}

View File

@@ -1,28 +1,28 @@
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 129b8de..fadb99a 100644 index 78d6060..dfa9de2 100644
--- a/src/vs/base/common/product.ts --- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts
@@ -68,6 +68,7 @@ export interface IProductConfiguration { @@ -69,6 +69,7 @@ export interface IProductConfiguration {
readonly extensionsGallery?: { readonly extensionsGallery?: {
readonly serviceUrl: string; readonly serviceUrl: string;
+ readonly cacheUrl?: string; + readonly cacheUrl?: string;
readonly itemUrl: string; readonly itemUrl: string;
readonly resourceUrlTemplate: string; readonly resourceUrlTemplate: string;
readonly controlUrl: string; readonly controlUrl: string;
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index d79c8a3..8b4153f 100644 index 09dfc64..fec0cfa 100644
--- a/src/vs/platform/product/common/product.ts --- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts
@@ -4,11 +4,12 @@ @@ -4,11 +4,12 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import { FileAccess } from 'vs/base/common/network'; import { FileAccess } from 'vs/base/common/network';
-import { isWeb, globals } from 'vs/base/common/platform'; -import { globals } from 'vs/base/common/platform';
+import { isWeb, isWindows, globals } from 'vs/base/common/platform'; +import { globals, isWindows } from 'vs/base/common/platform';
import { env } from 'vs/base/common/process'; import { env } from 'vs/base/common/process';
import { dirname, joinPath } from 'vs/base/common/resources';
import { IProductConfiguration } from 'vs/base/common/product'; import { IProductConfiguration } from 'vs/base/common/product';
import { dirname, joinPath } from 'vs/base/common/resources';
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
+import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; +import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';

158
patches/disable-cors.patch Normal file
View File

@@ -0,0 +1,158 @@
diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js
index 0cc92ec..43042d5 100644
--- a/src/bootstrap-window.js
+++ b/src/bootstrap-window.js
@@ -24,6 +24,7 @@
const bootstrapLib = bootstrap();
const preloadGlobals = sandboxGlobals();
const safeProcess = preloadGlobals.process;
+ const useCustomProtocol = safeProcess.sandboxed;
/**
* @typedef {import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration} ISandboxConfiguration
@@ -99,6 +100,11 @@
window.document.documentElement.setAttribute('lang', locale);
+ // Do not advertise AMD to avoid confusing UMD modules loaded with nodejs
+ if (!useCustomProtocol) {
+ window['define'] = undefined;
+ }
+
// Replace the patched electron fs with the original node fs for all AMD code (TODO@sandbox non-sandboxed only)
if (!safeProcess.sandboxed) {
require.define('fs', [], function () { return require.__$__nodeRequire('original-fs'); });
@@ -107,9 +113,11 @@
window['MonacoEnvironment'] = {};
const loaderConfig = {
- baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
+ baseUrl: useCustomProtocol ?
+ `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out` :
+ `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32' })}/out`,
'vs/nls': nlsConfig,
- preferScriptTags: true
+ preferScriptTags: useCustomProtocol
};
// use a trusted types policy when loading via script tags
@@ -143,6 +151,14 @@
loaderConfig.amdModulesPattern = /^vs\//;
}
+ // Cached data config (node.js loading only)
+ if (!useCustomProtocol && configuration.codeCachePath) {
+ loaderConfig.nodeCachedData = {
+ path: configuration.codeCachePath,
+ seed: modulePaths.join('')
+ };
+ }
+
// Signal before require.config()
if (typeof options?.beforeLoaderConfig === 'function') {
options.beforeLoaderConfig(loaderConfig);
diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts
index 41a3fe9..bbb06e3 100644
--- a/src/vs/base/common/network.ts
+++ b/src/vs/base/common/network.ts
@@ -166,16 +166,7 @@ class FileAccessImpl {
}
// Convert to `vscode-file` resource..
- if (
- // ...only ever for `file` resources
- uri.scheme === Schemas.file &&
- (
- // ...and we run in native environments
- platform.isNative ||
- // ...or web worker extensions on desktop
- (typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)
- )
- ) {
+ if (uri.scheme === Schemas.file && typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`) {
return uri.with({
scheme: Schemas.vscodeFileResource,
// We need to provide an authority here so that it can serve
diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts
index bde08d8..3f09ad1 100644
--- a/src/vs/platform/protocol/electron-main/protocolMainService.ts
+++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts
@@ -72,9 +72,24 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ
//#region file://
private handleFileRequest(request: Electron.ProtocolRequest, callback: ProtocolCallback) {
- const uri = URI.parse(request.url);
+ const fileUri = URI.parse(request.url);
+
+ // first check by validRoots
+ if (this.validRoots.findSubstr(fileUri)) {
+ return callback({
+ path: fileUri.fsPath
+ });
+ }
- this.logService.error(`Refused to load resource ${uri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
+ // then check by validExtensions
+ if (this.validExtensions.has(extname(fileUri))) {
+ return callback({
+ path: fileUri.fsPath
+ });
+ }
+
+ // finally block to load the resource
+ this.logService.error(`${Schemas.file}: Refused to load resource ${fileUri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
return callback({ error: -3 /* ABORTED */ });
}
diff --git a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
index 7cae207..1c54ac9 100644
--- a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
+++ b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
@@ -19,7 +19,7 @@ import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { IProductService } from 'vs/platform/product/common/productService';
-import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
+import { IStorageService } from 'vs/platform/storage/common/storage';
export class TimerService extends AbstractTimerService {
@@ -91,24 +91,23 @@ registerSingleton(ITimerService, TimerService);
//#region cached data logic
-const lastRunningCommitStorageKey = 'perf/lastRunningCommit';
-let _didUseCachedData: boolean | undefined = undefined;
-
export function didUseCachedData(productService: IProductService, storageService: IStorageService, environmentService: INativeWorkbenchEnvironmentService): boolean {
- // browser code loading: only a guess based on
- // this being the first start with the commit
- // or subsequent
- if (typeof _didUseCachedData !== 'boolean') {
- if (!environmentService.configuration.codeCachePath || !productService.commit) {
- _didUseCachedData = false; // we only produce cached data whith commit and code cache path
- } else if (storageService.get(lastRunningCommitStorageKey, StorageScope.GLOBAL) === productService.commit) {
- _didUseCachedData = true; // subsequent start on same commit, assume cached data is there
- } else {
- storageService.store(lastRunningCommitStorageKey, productService.commit, StorageScope.GLOBAL, StorageTarget.MACHINE);
- _didUseCachedData = false; // first time start on commit, assume cached data is not yet there
+ if (!Boolean((<any>window).require.getConfig().nodeCachedData)) {
+ return false;
+ }
+ // There are loader events that signal if cached data was missing, rejected,
+ // or used. The former two mean no cached data.
+ let cachedDataFound = 0;
+ for (const event of require.getStats()) {
+ switch (event.type) {
+ case LoaderEventType.CachedDataRejected:
+ return false;
+ case LoaderEventType.CachedDataFound:
+ cachedDataFound += 1;
+ break;
}
}
- return _didUseCachedData;
+ return cachedDataFound > 0;
}
//#endregion

View File

@@ -0,0 +1,48 @@
diff --git a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts
index fcd4485..8d97e5a 100644
--- a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts
+++ b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts
@@ -682,7 +682,7 @@ export class IssueReporter extends Disposable {
sourceSelect.innerText = '';
sourceSelect.append(this.makeOption('', localize('selectSource', "Select source"), true));
- sourceSelect.append(this.makeOption('vscode', localize('vscode', "Visual Studio Code"), false));
+ sourceSelect.append(this.makeOption('vscode', localize('vscode', "VSCodium"), false));
sourceSelect.append(this.makeOption('extension', localize('extension', "An extension"), false));
if (this.configuration.product.reportMarketplaceIssueUrl) {
sourceSelect.append(this.makeOption('marketplace', localize('marketplace', "Extensions marketplace"), false));
diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts
index 0c5855b..654f9a4 100644
--- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts
+++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts
@@ -144,7 +144,7 @@ class ReportExtensionSlowAction extends Action {
- Extension Name: \`${this.extension.name}\`
- Extension Version: \`${this.extension.version}\`
- OS Version: \`${osVersion}\`
-- VS Code version: \`${this._productService.version}\`\n\n${message}`);
+- VSCodium version: \`${this._productService.version}\`\n\n${message}`);
const url = `${this.repoInfo.base}/${this.repoInfo.owner}/${this.repoInfo.repo}/issues/new/?body=${body}&title=${title}`;
this._openerService.open(URI.parse(url));
diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/reportExtensionIssueAction.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/reportExtensionIssueAction.ts
index f1755db..e77be21 100644
--- a/src/vs/workbench/contrib/extensions/electron-sandbox/reportExtensionIssueAction.ts
+++ b/src/vs/workbench/contrib/extensions/electron-sandbox/reportExtensionIssueAction.ts
@@ -14,7 +14,7 @@ import { ExtensionType, IExtensionDescription } from 'vs/platform/extensions/com
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { URI } from 'vs/base/common/uri';
-const builtinExtensionIssueUrl = 'https://github.com/microsoft/vscode';
+const builtinExtensionIssueUrl = 'https://github.com/VSCodium/vscodium';
export class ReportExtensionIssueAction extends Action {
@@ -76,7 +76,7 @@ export class ReportExtensionIssueAction extends Action {
- Extension Name: \`${extension.description.name}\`
- Extension Version: \`${extension.description.version}\`
- OS Version: \`${osVersion}\`
-- VS Code version: \`${this.productService.version}\`\n\n${message}`
+- VSCodium version: \`${this.productService.version}\`\n\n${message}`
);
return `${baseUrl}${queryStringPrefix}body=${body}&title=${encodeURIComponent(title)}`;

View File

@@ -7,7 +7,7 @@ index 93424ca..133657e 100644
@memoize @memoize
get cachePath(): Promise<string> { get cachePath(): Promise<string> {
- const result = path.join(tmpdir(), `vscode-update-${this.productService.target}-${process.arch}`); - const result = path.join(tmpdir(), `vscode-update-${this.productService.target}-${process.arch}`);
+ const result = path.join(tmpdir(), `${this.productService.nameShort.toLowerCase()}-update-${this.productService.target}-${process.arch}`); + const result = path.join(tmpdir(), `${this.productService.applicationName}-update-${this.productService.target}-${process.arch}`);
return pfs.Promises.mkdir(result, { recursive: true }).then(() => result); return pfs.Promises.mkdir(result, { recursive: true }).then(() => result);
} }

View File

@@ -0,0 +1,257 @@
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
index 3d36081..5bac245 100644
--- a/extensions/github-authentication/src/githubServer.ts
+++ b/extensions/github-authentication/src/githubServer.ts
@@ -6,8 +6,6 @@
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import fetch, { Response } from 'node-fetch';
-import { v4 as uuid } from 'uuid';
-import { PromiseAdapter, promiseFromEvent } from './common/utils';
import { ExperimentationTelemetry } from './experimentationService';
import { AuthProviderType } from './github';
import { Log } from './common/logger';
@@ -15,8 +13,6 @@ import { Log } from './common/logger';
const localize = nls.loadMessageBundle();
const NETWORK_ERROR = 'network error';
-const AUTH_RELAY_SERVER = 'vscode-auth.github.com';
-// const AUTH_RELAY_STAGING_SERVER = 'client-auth-staging-14a768b.herokuapp.com';
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
constructor(private readonly Logger: Log) {
@@ -29,14 +25,6 @@ class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.
}
}
-function parseQuery(uri: vscode.Uri) {
- return uri.query.split('&').reduce((prev: any, current) => {
- const queryString = current.split('=');
- prev[queryString[0]] = queryString[1];
- return prev;
- }, {});
-}
-
export interface IGitHubServer extends vscode.Disposable {
login(scopes: string): Promise<string>;
getUserInfo(token: string): Promise<{ id: string, accountName: string }>;
@@ -96,11 +84,7 @@ async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): P
export class GitHubServer implements IGitHubServer {
friendlyName = 'GitHub';
type = AuthProviderType.github;
- private _statusBarItem: vscode.StatusBarItem | undefined;
- private _onDidManuallyProvideToken = new vscode.EventEmitter<string | undefined>();
- private _pendingStates = new Map<string, string[]>();
- private _codeExchangePromises = new Map<string, { promise: Promise<string>, cancel: vscode.EventEmitter<void> }>();
private _statusBarCommandId = `${this.type}.provide-manually`;
private _disposable: vscode.Disposable;
private _uriHandler = new UriEventHandler(this._logger);
@@ -115,150 +99,35 @@ export class GitHubServer implements IGitHubServer {
this._disposable.dispose();
}
- private isTestEnvironment(url: vscode.Uri): boolean {
- return /\.azurewebsites\.net$/.test(url.authority) || url.authority.startsWith('localhost:');
- }
-
- // TODO@joaomoreno TODO@TylerLeonhardt
- private async isNoCorsEnvironment(): Promise<boolean> {
- const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`));
- return (uri.scheme === 'https' && /^(vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority));
- }
-
public async login(scopes: string): Promise<string> {
this._logger.info(`Logging in for the following scopes: ${scopes}`);
- // TODO@joaomoreno TODO@TylerLeonhardt
- const nocors = await this.isNoCorsEnvironment();
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate${nocors ? '?nocors=true' : ''}`));
-
- if (this.isTestEnvironment(callbackUri)) {
- const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
- if (!token) { throw new Error('Sign in failed: No token provided'); }
-
- const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
- const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
- if (!scopesList.every(scope => {
- const included = tokenScopes.includes(scope);
- if (included || !scope.includes(':')) {
- return included;
- }
+ const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
+ if (!token) { throw new Error('Sign in failed: No token provided'); }
- return scope.split(':').some(splitScopes => {
- return tokenScopes.includes(splitScopes);
- });
- })) {
- throw new Error(`The provided token is does not match the requested scopes: ${scopes}`);
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
+ if (!scopesList.every(scope => {
+ const included = tokenScopes.includes(scope);
+ if (included || !scope.includes(':')) {
+ return included;
}
- return token;
- }
-
- this.updateStatusBarItem(true);
-
- const state = uuid();
- const existingStates = this._pendingStates.get(scopes) || [];
- this._pendingStates.set(scopes, [...existingStates, state]);
-
- const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com${nocors ? '&nocors=true' : ''}`);
- await vscode.env.openExternal(uri);
-
- // Register a single listener for the URI callback, in case the user starts the login process multiple times
- // before completing it.
- let codeExchangePromise = this._codeExchangePromises.get(scopes);
- if (!codeExchangePromise) {
- codeExchangePromise = promiseFromEvent(this._uriHandler.event, this.exchangeCodeForToken(scopes));
- this._codeExchangePromises.set(scopes, codeExchangePromise);
+ return scope.split(':').some(splitScopes => {
+ return tokenScopes.includes(splitScopes);
+ });
+ })) {
+ throw new Error(`The provided token is does not match the requested scopes: ${scopes}`);
}
- return Promise.race([
- codeExchangePromise.promise,
- promiseFromEvent<string | undefined, string>(this._onDidManuallyProvideToken.event, (token: string | undefined, resolve, reject): void => {
- if (!token) {
- reject('Cancelled');
- } else {
- resolve(token);
- }
- }).promise,
- new Promise<string>((_, reject) => setTimeout(() => reject('Cancelled'), 60000))
- ]).finally(() => {
- this._pendingStates.delete(scopes);
- codeExchangePromise?.cancel.fire();
- this._codeExchangePromises.delete(scopes);
- this.updateStatusBarItem(false);
- });
+ return token;
}
- private exchangeCodeForToken: (scopes: string) => PromiseAdapter<vscode.Uri, string> =
- (scopes) => async (uri, resolve, reject) => {
- const query = parseQuery(uri);
- const code = query.code;
-
- const acceptedStates = this._pendingStates.get(scopes) || [];
- if (!acceptedStates.includes(query.state)) {
- // A common scenario of this happening is if you:
- // 1. Trigger a sign in with one set of scopes
- // 2. Before finishing 1, you trigger a sign in with a different set of scopes
- // In this scenario we should just return and wait for the next UriHandler event
- // to run as we are probably still waiting on the user to hit 'Continue'
- this._logger.info('State not found in accepted state. Skipping this execution...');
- return;
- }
-
- const url = `https://${AUTH_RELAY_SERVER}/token?code=${code}&state=${query.state}`;
- this._logger.info('Exchanging code for token...');
-
- // TODO@joao: remove
- if (query.nocors) {
- try {
- const json: any = await vscode.commands.executeCommand('_workbench.fetchJSON', url, 'POST');
- this._logger.info('Token exchange success!');
- resolve(json.access_token);
- } catch (err) {
- reject(err);
- }
- } else {
- try {
- const result = await fetch(url, {
- method: 'POST',
- headers: {
- Accept: 'application/json'
- }
- });
-
- if (result.ok) {
- const json = await result.json();
- this._logger.info('Token exchange success!');
- resolve(json.access_token);
- } else {
- reject(result.statusText);
- }
- } catch (ex) {
- reject(ex);
- }
- }
- };
-
private getServerUri(path: string = '') {
const apiUri = vscode.Uri.parse('https://api.github.com');
return vscode.Uri.parse(`${apiUri.scheme}://${apiUri.authority}${path}`);
}
- private updateStatusBarItem(isStart?: boolean) {
- if (isStart && !this._statusBarItem) {
- this._statusBarItem = vscode.window.createStatusBarItem('status.git.signIn', vscode.StatusBarAlignment.Left);
- this._statusBarItem.name = localize('status.git.signIn.name', "GitHub Sign-in");
- this._statusBarItem.text = localize('signingIn', "$(mark-github) Signing in to github.com...");
- this._statusBarItem.command = this._statusBarCommandId;
- this._statusBarItem.show();
- }
-
- if (!isStart && this._statusBarItem) {
- this._statusBarItem.dispose();
- this._statusBarItem = undefined;
- }
- }
-
private async manuallyProvideUri() {
const uri = await vscode.window.showInputBox({
prompt: 'Uri',
@@ -290,41 +159,7 @@ export class GitHubServer implements IGitHubServer {
return getUserInfo(token, this.getServerUri('/user'), this._logger);
}
- public async sendAdditionalTelemetryInfo(token: string): Promise<void> {
- const nocors = await this.isNoCorsEnvironment();
-
- if (nocors) {
- return;
- }
-
- try {
- const result = await fetch('https://education.github.com/api/user', {
- headers: {
- Authorization: `token ${token}`,
- 'faculty-check-preview': 'true',
- 'User-Agent': 'Visual-Studio-Code'
- }
- });
-
- if (result.ok) {
- const json: { student: boolean, faculty: boolean } = await result.json();
-
- /* __GDPR__
- "session" : {
- "isEdu": { "classification": "NonIdentifiableDemographicInfo", "purpose": "FeatureInsight" }
- }
- */
- this._telemetryReporter.sendTelemetryEvent('session', {
- isEdu: json.student
- ? 'student'
- : json.faculty
- ? 'faculty'
- : 'none'
- });
- }
- } catch (e) {
- // No-op
- }
+ public async sendAdditionalTelemetryInfo(_token: string): Promise<void> {
}
public async checkEnterpriseVersion(token: string): Promise<void> {

View File

@@ -8,19 +8,30 @@ cd vscode || exit
../update_settings.sh ../update_settings.sh
# apply patches # apply patches
patch -u src/vs/platform/update/electron-main/updateService.win32.ts -i ../patches/update-cache-path.patch { set +x; } 2>/dev/null
patch -u resources/linux/rpm/code.spec.template -i ../patches/fix-rpm-spec.patch
git apply --ignore-whitespace ../patches/binary-name.patch for file in ../patches/*.patch; do
git apply --ignore-whitespace ../patches/custom-gallery.patch
for file in ../patches/user/*.patch; do
if [ -f "$file" ]; then if [ -f "$file" ]; then
echo applying user patch: $file; echo applying patch: $file;
if ! git apply --ignore-whitespace $file; then git apply --ignore-whitespace "$file"
if [ $? -ne 0 ]; then
echo failed to apply patch $file 1>&2 echo failed to apply patch $file 1>&2
fi fi
fi fi
done done
for file in ../patches/user/*.patch; do
if [ -f "$file" ]; then
echo applying user patch: $file;
git apply --ignore-whitespace "$file"
if [ $? -ne 0 ]; then
echo failed to apply patch $file 1>&2
fi
fi
done
set -x
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
CHILD_CONCURRENCY=1 yarn --frozen-lockfile --ignore-optional CHILD_CONCURRENCY=1 yarn --frozen-lockfile --ignore-optional
npm_config_argv='{"original":["--ignore-optional"]}' yarn postinstall npm_config_argv='{"original":["--ignore-optional"]}' yarn postinstall
@@ -60,8 +71,9 @@ win32x64UserAppId='setpath (["win32x64UserAppId"]; "{{2E1F05D1-C245-4562-81EE-28
urlProtocol='setpath(["urlProtocol"]; "vscodium")' urlProtocol='setpath(["urlProtocol"]; "vscodium")'
extensionAllowedProposedApi='setpath(["extensionAllowedProposedApi"]; getpath(["extensionAllowedProposedApi"]) + ["ms-vscode.cpptools", "ms-azuretools.vscode-docker", "visualstudioexptteam.vscodeintellicode", "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"])' extensionAllowedProposedApi='setpath(["extensionAllowedProposedApi"]; getpath(["extensionAllowedProposedApi"]) + ["ms-vscode.cpptools", "ms-azuretools.vscode-docker", "visualstudioexptteam.vscodeintellicode", "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"])'
serverDataFolderName='setpath(["serverDataFolderName"]; ".vscode-server-oss")' serverDataFolderName='setpath(["serverDataFolderName"]; ".vscode-server-oss")'
reportIssueUrl='setpath(["reportIssueUrl"]; "https://github.com/VSCodium/vscodium/issues/new/choose")'
product_json_changes="${checksumFailMoreInfoUrl} | ${tipsAndTricksUrl} | ${twitterUrl} | ${requestFeatureUrl} | ${documentationUrl} | ${introductoryVideosUrl} | ${extensionAllowedBadgeProviders} | ${updateUrl} | ${releaseNotesUrl} | ${keyboardShortcutsUrlMac} | ${keyboardShortcutsUrlLinux} | ${keyboardShortcutsUrlWin} | ${quality} | ${extensionsGallery} | ${linkProtectionTrustedDomains} | ${nameShort} | ${nameLong} | ${linuxIconName} | ${applicationName} | ${win32MutexName} | ${win32DirName} | ${win32NameVersion} | ${win32RegValueName} | ${win32AppUserModelId} | ${win32ShellNameShort} | ${win32x64UserAppId} | ${urlProtocol} | ${extensionAllowedProposedApi} | ${serverDataFolderName}" product_json_changes="${checksumFailMoreInfoUrl} | ${tipsAndTricksUrl} | ${twitterUrl} | ${requestFeatureUrl} | ${documentationUrl} | ${introductoryVideosUrl} | ${extensionAllowedBadgeProviders} | ${updateUrl} | ${releaseNotesUrl} | ${keyboardShortcutsUrlMac} | ${keyboardShortcutsUrlLinux} | ${keyboardShortcutsUrlWin} | ${quality} | ${extensionsGallery} | ${linkProtectionTrustedDomains} | ${nameShort} | ${nameLong} | ${linuxIconName} | ${applicationName} | ${win32MutexName} | ${win32DirName} | ${win32NameVersion} | ${win32RegValueName} | ${win32AppUserModelId} | ${win32ShellNameShort} | ${win32x64UserAppId} | ${urlProtocol} | ${extensionAllowedProposedApi} | ${serverDataFolderName} | ${reportIssueUrl}"
cat product.json.bak | jq "${product_json_changes}" > product.json cat product.json.bak | jq "${product_json_changes}" > product.json
cat product.json cat product.json

View File

@@ -3,8 +3,15 @@
TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)" TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
REPLACEMENT="s/$TELEMETRY_URLS/0\.0\.0\.0/g" REPLACEMENT="s/$TELEMETRY_URLS/0\.0\.0\.0/g"
#include common functions
. ../utils.sh
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i '' -E $REPLACEMENT if is_gnu_sed; then
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
else
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i '' -E $REPLACEMENT
fi
else else
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
fi fi

View File

@@ -3,18 +3,8 @@ DEFAULT_FALSE="'default': false"
TELEMETRY_ENABLE="'telemetry.enableTelemetry':" TELEMETRY_ENABLE="'telemetry.enableTelemetry':"
TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':" TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':"
is_gnu_sed () { #include common functions
sed --version >/dev/null 2>&1 . ../utils.sh
}
replace () {
echo $1
if is_gnu_sed; then
sed -i -E "$1" $2
else
sed -i '' -E "$1" $2
fi
}
update_setting () { update_setting () {
local FILENAME="$2" local FILENAME="$2"

View File

@@ -16,15 +16,15 @@ fi
# } # }
# `url` is URL_BASE + filename of asset e.g. # `url` is URL_BASE + filename of asset e.g.
# darwin: https://github.com/VSCodium/vscodium/releases/download/${LATEST_MS_TAG}/VSCodium-darwin-${LATEST_MS_TAG}.zip # darwin: https://github.com/VSCodium/vscodium/releases/download/${MS_TAG}/VSCodium-darwin-${MS_TAG}.zip
# `name` is $LATEST_MS_TAG # `name` is $MS_TAG
# `version` is $LATEST_MS_COMMIT # `version` is $MS_COMMIT
# `productVersion` is $LATEST_MS_TAG # `productVersion` is $MS_TAG
# `hash` in <filename>.sha1 # `hash` in <filename>.sha1
# `timestamp` is $(node -e 'console.log(Date.now())') # `timestamp` is $(node -e 'console.log(Date.now())')
# `sha256hash` in <filename>.sha256 # `sha256hash` in <filename>.sha256
URL_BASE=https://github.com/VSCodium/vscodium/releases/download/${LATEST_MS_TAG} URL_BASE=https://github.com/VSCodium/vscodium/releases/download/${MS_TAG}
# to make testing on forks easier # to make testing on forks easier
VERSIONS_REPO="${GITHUB_USERNAME}/versions" VERSIONS_REPO="${GITHUB_USERNAME}/versions"
@@ -37,9 +37,9 @@ generateJson() {
# generate parts # generate parts
local url=${URL_BASE}/${assetName} local url=${URL_BASE}/${assetName}
local name=$LATEST_MS_TAG local name=$MS_TAG
local version=$LATEST_MS_COMMIT local version=$MS_COMMIT
local productVersion=$LATEST_MS_TAG local productVersion=$MS_TAG
local timestamp=$(node -e 'console.log(Date.now())') local timestamp=$(node -e 'console.log(Date.now())')
local sha1hash=$(cat ${assetName}.sha1 | awk '{ print $1 }') local sha1hash=$(cat ${assetName}.sha1 | awk '{ print $1 }')
@@ -93,25 +93,25 @@ cd ..
if [[ "$OS_NAME" == "osx" ]]; then if [[ "$OS_NAME" == "osx" ]]; then
# zip, sha1, and sha256 files are all at top level dir # zip, sha1, and sha256 files are all at top level dir
ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip
VERSION_PATH="darwin/${VSCODE_ARCH}" VERSION_PATH="darwin/${VSCODE_ARCH}"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
elif [[ "$OS_NAME" == "windows" ]]; then elif [[ "$OS_NAME" == "windows" ]]; then
# system installer # system installer
ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe
VERSION_PATH="win32/${VSCODE_ARCH}/system" VERSION_PATH="win32/${VSCODE_ARCH}/system"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
# user installer # user installer
ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe
VERSION_PATH="win32/${VSCODE_ARCH}/user" VERSION_PATH="win32/${VSCODE_ARCH}/user"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
# windows archive # windows archive
ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip
VERSION_PATH="win32/${VSCODE_ARCH}/archive" VERSION_PATH="win32/${VSCODE_ARCH}/archive"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"
@@ -119,7 +119,7 @@ else # linux
# update service links to tar.gz file # update service links to tar.gz file
# see https://update.code.visualstudio.com/api/update/linux-x64/stable/VERSION # see https://update.code.visualstudio.com/api/update/linux-x64/stable/VERSION
# as examples # as examples
ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${LATEST_MS_TAG}.tar.gz ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz
VERSION_PATH="linux/${VSCODE_ARCH}" VERSION_PATH="linux/${VSCODE_ARCH}"
JSON="$(generateJson ${ASSET_NAME})" JSON="$(generateJson ${ASSET_NAME})"
updateLatestVersion "$VERSION_PATH" "$JSON" updateLatestVersion "$VERSION_PATH" "$JSON"

16
utils.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
#All common functions can be added to this file
is_gnu_sed () {
sed --version >/dev/null 2>&1
}
replace () {
echo $1
if is_gnu_sed; then
sed -i -E "$1" $2
else
sed -i '' -E "$1" $2
fi
}