prepare_vscode.sh 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. export npm_config_arch="$BUILDARCH"
  3. export npm_config_target_arch="$BUILDARCH"
  4. cp -rp src/* vscode/
  5. cd vscode || exit
  6. ../update_settings.sh
  7. # apply patches
  8. patch -u src/vs/platform/update/electron-main/updateService.win32.ts -i ../patches/update-cache-path.patch
  9. yarn --frozen-lockfile
  10. yarn postinstall
  11. mv product.json product.json.bak
  12. # set fields in product.json
  13. tipsAndTricksUrl='setpath(["tipsAndTricksUrl"]; "https://go.microsoft.com/fwlink/?linkid=852118")'
  14. twitterUrl='setpath(["twitterUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533687")'
  15. requestFeatureUrl='setpath(["requestFeatureUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533482")'
  16. documentationUrl='setpath(["documentationUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533484#vscode")'
  17. introductoryVideosUrl='setpath(["introductoryVideosUrl"]; "https://go.microsoft.com/fwlink/?linkid=832146")'
  18. extensionAllowedBadgeProviders='setpath(["extensionAllowedBadgeProviders"]; ["api.bintray.com", "api.travis-ci.com", "api.travis-ci.org", "app.fossa.io", "badge.fury.io", "badge.waffle.io", "badgen.net", "badges.frapsoft.com", "badges.gitter.im", "badges.greenkeeper.io", "cdn.travis-ci.com", "cdn.travis-ci.org", "ci.appveyor.com", "circleci.com", "cla.opensource.microsoft.com", "codacy.com", "codeclimate.com", "codecov.io", "coveralls.io", "david-dm.org", "deepscan.io", "dev.azure.com", "flat.badgen.net", "gemnasium.com", "githost.io", "gitlab.com", "godoc.org", "goreportcard.com", "img.shields.io", "isitmaintained.com", "marketplace.visualstudio.com", "nodesecurity.io", "opencollective.com", "snyk.io", "travis-ci.com", "travis-ci.org", "visualstudio.com", "vsmarketplacebadge.apphb.com", "www.bithound.io", "www.versioneye.com"])'
  19. updateUrl='setpath(["updateUrl"]; "https://vscodium.now.sh")'
  20. releaseNotesUrl='setpath(["releaseNotesUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533483#vscode")'
  21. keyboardShortcutsUrlMac='setpath(["keyboardShortcutsUrlMac"]; "https://go.microsoft.com/fwlink/?linkid=832143")'
  22. keyboardShortcutsUrlLinux='setpath(["keyboardShortcutsUrlLinux"]; "https://go.microsoft.com/fwlink/?linkid=832144")'
  23. keyboardShortcutsUrlWin='setpath(["keyboardShortcutsUrlWin"]; "https://go.microsoft.com/fwlink/?linkid=832145")'
  24. quality='setpath(["quality"]; "stable")'
  25. extensionsGallery='setpath(["extensionsGallery"]; {"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items"})'
  26. nameShort='setpath(["nameShort"]; "VSCodium")'
  27. nameLong='setpath(["nameLong"]; "VSCodium")'
  28. linuxIconName='setpath(["linuxIconName"]; "vscodium")'
  29. applicationName='setpath(["applicationName"]; "codium")'
  30. win32MutexName='setpath(["win32MutexName"]; "vscodium")'
  31. win32DirName='setpath(["win32DirName"]; "VSCodium")'
  32. win32NameVersion='setpath(["win32NameVersion"]; "VSCodium")'
  33. win32RegValueName='setpath(["win32RegValueName"]; "VSCodium")'
  34. win32AppUserModelId='setpath(["win32AppUserModelId"]; "Microsoft.VSCodium")'
  35. win32ShellNameShort='setpath(["win32ShellNameShort"]; "VSCodium")'
  36. win32x64UserAppId='setpath (["win32x64UserAppId"]; "{{2E1F05D1-C245-4562-81EE-28188DB6FD17}")'
  37. urlProtocol='setpath(["urlProtocol"]; "vscodium")'
  38. extensionAllowedProposedApi='setpath(["extensionAllowedProposedApi"]; getpath(["extensionAllowedProposedApi"]) + ["ms-vsliveshare.vsliveshare"])'
  39. product_json_changes="${tipsAndTricksUrl} | ${twitterUrl} | ${requestFeatureUrl} | ${documentationUrl} | ${introductoryVideosUrl} | ${extensionAllowedBadgeProviders} | ${updateUrl} | ${releaseNotesUrl} | ${keyboardShortcutsUrlMac} | ${keyboardShortcutsUrlLinux} | ${keyboardShortcutsUrlWin} | ${quality} | ${extensionsGallery} | ${nameShort} | ${nameLong} | ${linuxIconName} | ${applicationName} | ${win32MutexName} | ${win32DirName} | ${win32NameVersion} | ${win32RegValueName} | ${win32AppUserModelId} | ${win32ShellNameShort} | ${win32x64UserAppId} | ${urlProtocol} | ${extensionAllowedProposedApi}"
  40. cat product.json.bak | jq "${product_json_changes}" > product.json
  41. cat product.json
  42. ../undo_telemetry.sh
  43. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  44. # microsoft adds their apt repo to sources
  45. # unless the app name is code-oss
  46. # as we are renaming the application to vscodium
  47. # we need to edit a line in the post install template
  48. sed -i "s/code-oss/codium/" resources/linux/debian/postinst.template
  49. fi