Compare commits

...

23 Commits

Author SHA1 Message Date
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
Baptiste Augrain
bbc6e8f4b7 Merge pull request #756 from larryw3i/larryw3i-patch-1
using snap to install codium requires classic mode
2021-07-15 11:10:03 +02:00
atesca09
d29337f328 Fix custom-gallery patch (#758)
* Fix custom-gallery patch

* Bump GA to node 14

Co-authored-by: Atesca <2404098-atesca@users.noreply.gitlab.com>
2021-07-10 07:09:37 -07:00
Larry Wei
ca52c1cfda using snap to install codium requires classic mode 2021-07-06 15:15:11 +08:00
Peter Squicciarini
c7cc061077 Merge pull request #742 from ShadowCreator250/add-extension-links-to-readme
README: add links to marketplace for extensions included during build process
2021-07-02 09:57:13 -07:00
Peter Squicciarini
34b5dbce34 Merge pull request #753 from daiyam/fix-preview
fix markdown's preview
2021-07-02 09:56:45 -07:00
Peter Squicciarini
cb8d774c77 Merge pull request #754 from daiyam/doc 2021-07-02 09:47:54 -07:00
Baptiste Augrain
6a5ba92d10 add link to build doc 2021-06-30 10:29:54 +02:00
Baptiste Augrain
643b0f869d - add build doc
- improve terminal doc
2021-06-30 10:24:06 +02:00
Baptiste Augrain
7d636ce0f7 build media files used for the preview 2021-06-29 20:02:52 +02:00
Peter Squicciarini
5b3b76e65b Merge pull request #748 from swinder0161/user-patches
Add ability to apply user specific patches to vscode source
2021-06-26 11:13:10 -07:00
Swinder Pal Singh Juneja
64e101b963 Add ability to apply user specific patches to vscode source 2021-06-21 08:50:25 +05:30
ShadowCreator250
527ce5efd2 README: add links to marketplace for extensions included during build process 2021-06-17 11:12:59 +02:00
19 changed files with 201 additions and 43 deletions

View File

@@ -38,7 +38,7 @@ jobs:
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12.14.1 node-version: 14
- name: Install Yarn - name: Install Yarn
run: npm install -g yarn run: npm install -g yarn

View File

@@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12.14.1 node-version: 14
- name: Check PR or cron - name: Check PR or cron
run: | run: |

View File

@@ -25,7 +25,7 @@ jobs:
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12.18.3 node-version: 14
- name: Install Yarn - name: Install Yarn
run: npm install -g yarn run: npm install -g yarn

View File

@@ -12,6 +12,8 @@
- [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)
- [From Linux .tar.gz](#from-linux-targz)
- [How to build VSCodium](https://github.com/VSCodium/vscodium/blob/master/docs/build.md)
## <a id="disable-telemetry"></a>Getting all the Telemetry Out ## <a id="disable-telemetry"></a>Getting all the Telemetry Out
@@ -135,6 +137,7 @@ $ defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false
## <a id="terminal-support"></a>How do I open VSCodium from the terminal? ## <a id="terminal-support"></a>How do I open VSCodium from the terminal?
For MacOS and Windows:
- Go to the command palette (View | Command Palette...) - Go to the command palette (View | Command Palette...)
- Choose `Shell command: Install 'codium' command in PATH`. - Choose `Shell command: Install 'codium' command in PATH`.
@@ -148,3 +151,9 @@ This allows you to open files or directories in VSCodium directly from your term
``` ```
Feel free to alias this command to something easier to type in your shell profile (e.g. `alias code=codium`). Feel free to alias this command to something easier to type in your shell profile (e.g. `alias code=codium`).
On Linux, when installed with a package manager, `codium` has been installed in your `PATH`.
### <a id="from-linux-targz"></a>From Linux .tar.gz
When the archive `VSCodium-linux-<arch>-<version>.tar.gz` is extracted, the main entry point for VSCodium is `./bin/codium`.

View File

@@ -68,7 +68,7 @@ scoop install vscodium
VSCodium is available in the [Snap Store](https://snapcraft.io/) as [Codium](https://snapcraft.io/codium), published by the [Snapcrafters](https://github.com/snapcrafters/codium) community. VSCodium is available in the [Snap Store](https://snapcraft.io/) as [Codium](https://snapcraft.io/codium), published by the [Snapcrafters](https://github.com/snapcrafters/codium) community.
If your GNU/Linux distribution has support for [snaps](https://snapcraft.io/docs/installing-snapd): If your GNU/Linux distribution has support for [snaps](https://snapcraft.io/docs/installing-snapd):
```bash ```bash
snap install codium snap install codium --classic
``` ```
#### <a id="install-with-package-manager"></a>Install with Package Manager (GNU/Linux) #### <a id="install-with-package-manager"></a>Install with Package Manager (GNU/Linux)
@@ -101,8 +101,8 @@ If you want to build from source yourself, head over to [Microsoft's vscode repo
Microsoft's build process (which we are running to build the binaries) does download additional files. This was brought up in [Microsoft/vscode#49159](https://github.com/Microsoft/vscode/issues/49159) and [Microsoft/vscode#45978](https://github.com/Microsoft/vscode/issues/45978). These are the packages downloaded during build: Microsoft's build process (which we are running to build the binaries) does download additional files. This was brought up in [Microsoft/vscode#49159](https://github.com/Microsoft/vscode/issues/49159) and [Microsoft/vscode#45978](https://github.com/Microsoft/vscode/issues/45978). These are the packages downloaded during build:
- Extensions from the Microsoft Marketplace: - Extensions from the Microsoft Marketplace:
- ms-vscode.node-debug2 - [ms-vscode.node-debug2](https://marketplace.visualstudio.com/items?itemName=ms-vscode.node-debug2)
- ms-vscode.node-debug - [ms-vscode.node-debug](https://marketplace.visualstudio.com/items?itemName=ms-vscode.node-debug)
- From [Electron releases](https://github.com/electron/electron/releases) (using [gulp-atom-electron](https://github.com/joaomoreno/gulp-atom-electron)) - From [Electron releases](https://github.com/electron/electron/releases) (using [gulp-atom-electron](https://github.com/joaomoreno/gulp-atom-electron))
- electron - electron
- ffmpeg - ffmpeg
@@ -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

@@ -15,6 +15,7 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
yarn valid-layers-check yarn valid-layers-check
yarn gulp compile-build yarn gulp compile-build
yarn gulp compile-extension-media
yarn gulp compile-extensions-build yarn gulp compile-extensions-build
yarn gulp minify-vscode yarn gulp minify-vscode

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

71
docs/build.md Normal file
View File

@@ -0,0 +1,71 @@
# Build
## Table of Contents
- [Dependencies](#dependencies)
- [Linux](#dependencies-linux)
- [MacOS](#dependencies-macos)
- [Windows](#dependencies-windows)
- [Build Scripts](#build-scripts)
- [Build in Docker](#build-docker)
## <a id="dependencies"></a>Dependencies
- node 14
- yarn
- jq
### <a id="dependencies-linux"></a>Linux
- libx11-dev
- libxkbfile-dev
- libsecret-1-dev
- fakeroot
- rpm
- rpmbuild
- dpkg
### <a id="dependencies-macos"></a>MacOS
### <a id="dependencies-windows"></a>Windows
- powershell
- git
- sed
## <a id="build-scripts"></a>Build Scripts
Each platform has its build helper script in the directory `build`.
- Linux: `./build/build_linux.sh`
- MacOS: `./build/build_macos_.sh`
- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build_windows.ps1`
## <a id="build-docker"></a>Build in Docker
To build for Linux, you can alternatively build VSCodium in docker
Firstly, create the container with:
```
docker run -ti --volume=<local vscodium source>:/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-x64 bash
```
When inside the container, you can use the following commands to build:
```
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs desktop-file-utils
npm install -g yarn
git clone https://github.com/VSCodium/vscodium.git
cd vscodium
./get_repo.sh
export SHOULD_BUILD=yes
export OS_NAME=linux
export VSCODE_ARCH=x64
./build.sh
```

View File

@@ -1,12 +1,23 @@
#!/bin/bash #!/bin/bash
# figure out latest tag by calling MS update API # figure out latest tag by calling MS update API
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol) if [ "$INSIDER" == "1" ]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/insider/lol)
else
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
fi
export LATEST_MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version') export LATEST_MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
export LATEST_MS_TAG=$(echo $UPDATE_INFO | jq -r '.name') export LATEST_MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
echo "Got the latest MS tag: ${LATEST_MS_TAG}" echo "Got the latest MS tag: ${LATEST_MS_TAG} version: ${LATEST_MS_COMMIT}"
git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1 if [ "$INSIDER" == "1" ]; then
mkdir -p vscode; cd vscode
git init ; git remote add origin https://github.com/Microsoft/vscode.git
git fetch --depth 1 origin $LATEST_MS_COMMIT; git checkout FETCH_HEAD
cd ..
else
git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1
fi
# for GH actions # for GH actions
if [[ $GITHUB_ENV ]]; then if [[ $GITHUB_ENV ]]; then

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

@@ -2,14 +2,14 @@ diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 129b8de..fadb99a 100644 index 129b8de..fadb99a 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
@@ -62,6 +62,7 @@ export interface IProductConfiguration { @@ -68,6 +68,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 controlUrl: string; readonly controlUrl: string;
readonly recommendationsUrl: 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 d79c8a3..8b4153f 100644
--- a/src/vs/platform/product/common/product.ts --- a/src/vs/platform/product/common/product.ts

13
patches/fix-cors.patch Normal file
View File

@@ -0,0 +1,13 @@
diff --git a/src/main.js b/src/main.js
index f91f7b7..0ec4b6f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -174,7 +174,7 @@ function configureCommandlineSwitchesSync(cliArgs) {
// Read argv config
const argvConfig = readArgvConfigSync();
- let browserCodeLoadingStrategy = typeof codeCachePath === 'string' ? 'bypassHeatCheck' : 'none';
+ let browserCodeLoadingStrategy = undefined;
Object.keys(argvConfig).forEach(argvKey => {
const argvValue = argvConfig[argvKey];

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);
} }

1
patches/user/readme.txt Normal file
View File

@@ -0,0 +1 @@
store user patches at location patches/user and those will be applied to vscode source git by the scripts

View File

@@ -8,10 +8,23 @@ 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 for file in ../patches/*.patch; do
patch -u resources/linux/rpm/code.spec.template -i ../patches/fix-rpm-spec.patch if [ -f "$file" ]; then
git apply --ignore-whitespace ../patches/binary-name.patch echo applying patch: $file;
git apply --ignore-whitespace ../patches/custom-gallery.patch if ! git apply --ignore-whitespace $file; then
echo failed to apply patch $file 1>&2
fi
fi
done
for file in ../patches/user/*.patch; do
if [ -f "$file" ]; then
echo applying user patch: $file;
if ! git apply --ignore-whitespace $file; then
echo failed to apply patch $file 1>&2
fi
fi
done
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

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
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 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"

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
}