[arch-commits] Commit in code/trunk (PKGBUILD code.sh)
Massimiliano Torromeo
mtorromeo at gemini.archlinux.org
Tue Sep 6 16:19:11 UTC 2022
Date: Tuesday, September 6, 2022 @ 16:19:11
Author: mtorromeo
Revision: 1294454
upgpkg: code 1.71.0-2: fixed loading of electron-flags.conf and code-flags.conf
Modified:
code/trunk/PKGBUILD
code/trunk/code.sh
----------+
PKGBUILD | 4 ++--
code.sh | 19 ++++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-09-06 16:14:23 UTC (rev 1294453)
+++ PKGBUILD 2022-09-06 16:19:11 UTC (rev 1294454)
@@ -14,7 +14,7 @@
# Important: Remember to check https://github.com/microsoft/vscode/blob/master/.yarnrc (choose correct tag) for target electron version
_electron=electron19
pkgver=1.71.0
-pkgrel=1
+pkgrel=2
arch=('x86_64')
url='https://github.com/microsoft/vscode'
license=('MIT')
@@ -30,7 +30,7 @@
'product_json.diff')
sha512sums=('SKIP'
'6e8ee1df4dd982434a8295ca99e786a536457c86c34212546e548b115081798c5492a79f99cd5a3f1fa30fb71d29983aaabc2c79f4895d4a709d8354e9e2eade'
- 'b8bdb0e53cf8748140ed444c9b02cb6a57a7e1e120d96861d4cc9f79744a987f0253c052a238c78aa2c3f86459c4afb6f3b687435f0588d8f640822a9908b257'
+ '88b0e491b18bb10b1293217c92b984d863a711a5d743c3e929e889e1a927e62e639811b2feaa8dec4f5eac49610c6e5ce75f874d526fc7059134ee612c7991e1'
'b1aa0d7c5b3e3e8ba1172822d75ea38e90efc431b270e0b4ca9e45bf9c0be0f60922c8618969ef071b5b6dbd9ac9f030294f1bf49bcc28c187b46d113dca63a7')
# Even though we don't officially support other archs, let's
Modified: code.sh
===================================================================
--- code.sh 2022-09-06 16:14:23 UTC (rev 1294453)
+++ code.sh 2022-09-06 16:19:11 UTC (rev 1294454)
@@ -1,4 +1,21 @@
#!/bin/bash
+set -euo pipefail
+
+name=code
+flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
+
+declare -a flags
+
+if [[ -f "${flags_file}" ]]; then
+ mapfile -t < "${flags_file}"
+fi
+
+for line in "${MAPFILE[@]}"; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ flags+=("${line}")
+ fi
+done
+
# don't edit the electron binary name here! simply change the variable in the PKGBUILD and we will sed it into the correct one :)
-ELECTRON_RUN_AS_NODE=1 exec electron /usr/lib/code/out/cli.js /usr/lib/code/code.js "$@"
+exec electron /usr/lib/code/out/cli.js /usr/lib/code/code.js "${flags[@]}" "$@"
More information about the arch-commits
mailing list