From 868f3375b226db797570cc6d1130c27f0b3190fd Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 31 Jul 2024 10:52:07 +0100 Subject: [PATCH] Make sonarcloud happier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- dockerbuild/Dockerfile | 4 ++-- playwright/Dockerfile | 2 +- scripts/hak/hakEnv.ts | 7 ++++--- src/updater.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dockerbuild/Dockerfile b/dockerbuild/Dockerfile index d44dc7fd96..0aee3d7168 100644 --- a/dockerbuild/Dockerfile +++ b/dockerbuild/Dockerfile @@ -4,8 +4,8 @@ FROM rust:buster ENV DEBIAN_FRONTEND noninteractive RUN curl --proto "=https" -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn -RUN apt-get -qq update && apt-get -qq dist-upgrade && \ - apt-get -qq install --no-install-recommends \ +RUN apt-get -qq update && apt-get -y -qq dist-upgrade && \ + apt-get -y -qq install --no-install-recommends \ # tclsh is required for building SQLite as part of SQLCipher tcl \ # libsecret-1-dev is required even for prebuild keytar diff --git a/playwright/Dockerfile b/playwright/Dockerfile index 0bedbd5142..e4be962e44 100644 --- a/playwright/Dockerfile +++ b/playwright/Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/playwright:v1.45.3-jammy WORKDIR /work/element-desktop -RUN apt-get update && apt-get -y install xvfb +RUN apt-get update && apt-get -y install xvfb && apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/* USER 1000:1000 diff --git a/scripts/hak/hakEnv.ts b/scripts/hak/hakEnv.ts index 4ad0be1cd0..0a5b11afc2 100644 --- a/scripts/hak/hakEnv.ts +++ b/scripts/hak/hakEnv.ts @@ -97,15 +97,16 @@ export default class HakEnv { } public makeGypEnv(): Record { - return Object.assign({}, process.env, { + return { + ...process.env, npm_config_arch: this.target.arch, npm_config_target_arch: this.target.arch, npm_config_disturl: "https://electronjs.org/headers", npm_config_runtime: this.runtime, npm_config_target: this.runtimeVersion, - npm_config_build_from_source: true, + npm_config_build_from_source: "true", npm_config_devdir: path.join(os.homedir(), ".electron-gyp"), - }); + }; } public wantsStaticSqlCipher(): boolean { diff --git a/src/updater.ts b/src/updater.ts index 937e85728d..77fe997f24 100644 --- a/src/updater.ts +++ b/src/updater.ts @@ -79,7 +79,7 @@ async function pollForUpdates(): Promise { export async function start(updateBaseUrl: string): Promise { if (!(await available(updateBaseUrl))) return; - if (updateBaseUrl.slice(-1) !== "/") { + if (!updateBaseUrl.endsWith("/")) { updateBaseUrl = updateBaseUrl + "/"; }