From d164e43b788b6e2d040b1eeac3018cda70b0a7a0 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 9 Dec 2021 02:30:35 +0100 Subject: [PATCH] fix(1.63): update patch (#937) --- get_repo.sh | 40 +++++++++++++++++++-------------------- patches/binary-name.patch | 20 +++++--------------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/get_repo.sh b/get_repo.sh index d263b85..da76377 100755 --- a/get_repo.sh +++ b/get_repo.sh @@ -8,26 +8,26 @@ 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') + 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') + 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 + 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}" @@ -39,6 +39,6 @@ cd .. # for GH actions if [[ $GITHUB_ENV ]]; then - echo "MS_TAG=$MS_TAG" >> $GITHUB_ENV - echo "MS_COMMIT=$MS_COMMIT" >> $GITHUB_ENV + echo "MS_TAG=$MS_TAG" >> $GITHUB_ENV + echo "MS_COMMIT=$MS_COMMIT" >> $GITHUB_ENV fi diff --git a/patches/binary-name.patch b/patches/binary-name.patch index 30a0065..4323202 100644 --- a/patches/binary-name.patch +++ b/patches/binary-name.patch @@ -1,8 +1,8 @@ diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index 6d3a369..57009d4 100644 +index df089a6..7aeb54b 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js -@@ -276,7 +276,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op +@@ -286,7 +286,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' })); } else if (platform === 'darwin') { const shortcut = gulp.src('resources/darwin/bin/code.sh') @@ -11,20 +11,11 @@ index 6d3a369..57009d4 100644 all = es.merge(all, shortcut); } -@@ -483,7 +483,7 @@ const generateVSCodeConfigurationTask = task.define('generate-vscode-configurati - const arch = process.env['VSCODE_ARCH']; - const appRoot = path.join(buildDir, `VSCode-darwin-${arch}`); - const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app'; -- const appPath = path.join(appRoot, appName, 'Contents', 'Resources', 'app', 'bin', 'code'); -+ const appPath = path.join(appRoot, appName, 'Contents', 'Resources', 'app', 'bin', product.applicationName); - const codeProc = cp.exec( - `${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`, - (err, stdout, stderr) => { diff --git a/src/vs/platform/native/electron-main/nativeHostMainService.ts b/src/vs/platform/native/electron-main/nativeHostMainService.ts -index 692db1d..cd173bc 100644 +index bd4dc01..02cbbc2 100644 --- a/src/vs/platform/native/electron-main/nativeHostMainService.ts +++ b/src/vs/platform/native/electron-main/nativeHostMainService.ts -@@ -341,7 +341,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain +@@ -355,7 +355,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain } private async getShellCommandLink(): Promise<{ readonly source: string, readonly target: string }> { @@ -33,7 +24,7 @@ index 692db1d..cd173bc 100644 const source = `/usr/local/bin/${this.productService.applicationName}`; // Ensure source exists -@@ -551,7 +551,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain +@@ -565,7 +565,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain // macOS if (this.environmentMainService.isBuilt) { @@ -42,4 +33,3 @@ index 692db1d..cd173bc 100644 } return join(this.environmentMainService.appRoot, 'scripts', 'code-cli.sh'); -