From e65506babb6ca7cbba3bf894c5923dedc19ecc38 Mon Sep 17 00:00:00 2001 From: flysand7 Date: Fri, 28 Jul 2023 20:53:20 +1100 Subject: [PATCH] Remove root object parens from jsons --- build.py | 10 +++++++--- src/library.json | 5 ----- src/linux/tinyrt.json | 3 --- src/windows/tinyrt.json | 4 ---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/build.py b/build.py index e5caabd..2b914ec 100755 --- a/build.py +++ b/build.py @@ -88,7 +88,9 @@ tinyrt_apis = [] try: print(f" -> Reading file '{tinyrt_config_path}'") with open(tinyrt_config_path, 'r') as tinyrt_config_file: - tinyrt_config = pyjson5.load(tinyrt_config_file) + string = tinyrt_config_file.read() + json = '{' + string + '}' + tinyrt_config = pyjson5.loads(json) except Exception as error: print(f" -> [ERROR] reading file '{tinyrt_config_path}'") print(f" * {error}") @@ -119,7 +121,9 @@ library_config_path = os.path.join('src', 'library.json') try: print(f" -> Reading file '{library_config_path}'") with open(library_config_path, 'r') as library_config_file: - library_config = pyjson5.load(library_config_file) + string = library_config_file.read() + json = '{' + string + '}' + library_config = pyjson5.loads(json) except Exception as error: print(f" -> [ERROR] reading file '{library_config_path}'") print(f" * {error}") @@ -248,4 +252,4 @@ if args.test: if target == 'linux': compile([args.test, cia_lib, crt_lib], 'a', '-pie') elif target == 'windows': - compile([args.test, cia_lib, crt_lib], 'a.exe', '-lkernel32.lib') + compile([args.test, cia_lib, crt_lib], 'a', '-lkernel32.lib') diff --git a/src/library.json b/src/library.json index 6c459a8..616554a 100644 --- a/src/library.json +++ b/src/library.json @@ -1,5 +1,3 @@ -{ - // Manifest file for the ciabatta build. // Platform sections describe available platforms and @@ -76,6 +74,3 @@ apis: [ ] } ] - -// END -} \ No newline at end of file diff --git a/src/linux/tinyrt.json b/src/linux/tinyrt.json index 58f809b..85639ae 100644 --- a/src/linux/tinyrt.json +++ b/src/linux/tinyrt.json @@ -1,4 +1,3 @@ -{ // This file contains TinyRT API subsets that are exported // for this operating system, one name per line. This file @@ -8,5 +7,3 @@ rt_api_file: true, rt_api_program: true, rt_api_shell: false, - -} \ No newline at end of file diff --git a/src/windows/tinyrt.json b/src/windows/tinyrt.json index f82eb3f..acea106 100644 --- a/src/windows/tinyrt.json +++ b/src/windows/tinyrt.json @@ -1,5 +1,3 @@ -{ - // This file contains TinyRT API subsets that are exported // for this operating system, one name per line. This file // is used in a build script to generate tinyrt_macro file @@ -8,5 +6,3 @@ rt_api_file: true, rt_api_program: true, rt_api_shell: false, - -} \ No newline at end of file