From a8c4e0214fa7f1fc3c4a721f89883f2538bbeb14 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 11 Sep 2018 06:44:52 -0400 Subject: [PATCH] fix https://github.com/uBlockOrigin/uBlock-issues/issues/217, https://github.com/uBlockOrigin/uBlock-issues/issues/218 --- tools/make-webext-meta.py | 4 ++-- tools/make-webext.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/make-webext-meta.py b/tools/make-webext-meta.py index 15f8946e5..b9c7e3551 100644 --- a/tools/make-webext-meta.py +++ b/tools/make-webext-meta.py @@ -17,7 +17,7 @@ with open(os.path.join(proj_dir, 'dist', 'version')) as f: webext_manifest = {} webext_manifest_file = os.path.join(build_dir, 'manifest.json') -with open(webext_manifest_file) as f2: +with open(webext_manifest_file, encoding='utf-8') as f2: webext_manifest = json.load(f2) webext_manifest['version'] = version @@ -28,6 +28,6 @@ if match: webext_manifest['short_name'] += ' dev build' webext_manifest['browser_action']['default_title'] += ' dev build' -with open(webext_manifest_file, 'w') as f2: +with open(webext_manifest_file, mode='w', encoding='utf-8') as f2: json.dump(webext_manifest, f2, indent=2, separators=(',', ': '), sort_keys=True) f2.write('\n') diff --git a/tools/make-webext.sh b/tools/make-webext.sh index c77b5c0df..cb0ec9fe2 100755 --- a/tools/make-webext.sh +++ b/tools/make-webext.sh @@ -2,6 +2,9 @@ # # This script assumes a linux environment +# https://github.com/uBlockOrigin/uBlock-issues/issues/217 +set -e + echo "*** uBlock0.webext: Creating web store package" echo "*** uBlock0.webext: Copying files" @@ -45,7 +48,7 @@ cp -R src/web_accessible_resources $DES/ python3 tools/import-war.py $DES/ echo "*** uBlock0.webext: Generating meta..." -python tools/make-webext-meta.py $DES/ +python3 tools/make-webext-meta.py $DES/ if [ "$1" = all ]; then echo "*** uBlock0.webext: Creating package..."