Skip to content

Commit 0a244de

Browse files
committed
reading None types should not emit into the path or target components when reconfiguring
1 parent 00db57f commit 0a244de

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

configure

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,59 +48,59 @@ def reconfigure(config, path):
4848
with open(path, 'r') as infile:
4949
info = json.load(infile)
5050
if 'version' in info and info['version'] == config.version:
51-
if 'command' in info:
51+
if 'command' in info and info['command'] is not None:
5252
config.command = info['command']
53-
if 'project' in info:
53+
if 'project' in info and info['project'] is not None:
5454
config.command = info['project']
55-
if 'script_path' in info:
55+
if 'script_path' in info and info['script_path'] is not None:
5656
config.script_path = Path(info['script_path'])
57-
if 'build_script_path' in info:
57+
if 'build_script_path' in info and info['build_script_path'] is not None:
5858
config.build_script_path = Path(info['build_script_path'])
59-
if 'source_root' in info:
59+
if 'source_root' in info and info['source_root'] is not None:
6060
config.source_root = Path(info['source_root'])
61-
if 'target' in info:
61+
if 'target' in info and info['target'] is not None:
6262
config.target = Target(info['target'])
63-
if 'system_root' in info:
63+
if 'system_root' in info and info['system_root'] is not None:
6464
config.system_root = Path(info['system_root'])
65-
if 'toolchain' in info:
65+
if 'toolchain' in info and info['toolchain'] is not None:
6666
config.toolchain = info['toolchain']
67-
if 'build_directory' in info:
67+
if 'build_directory' in info and info['build_directory'] is not None:
6868
config.build_directory = Path(info['build_directory'])
69-
if 'intermediate_directory' in info:
69+
if 'intermediate_directory' in info and info['intermediate_directory'] is not None:
7070
config.intermediate_directory = Path(info['intermediate_directory'])
71-
if 'module_cache_directory' in info:
71+
if 'module_cache_directory' in info and info['module_cache_directory'] is not None:
7272
config.module_cache_directory = Path(info['module_cache_directory'])
73-
if 'install_directory' in info:
73+
if 'install_directory' in info and info['install_directory'] is not None:
7474
config.install_directory = Path(info['install_directory'])
75-
if 'prefix' in info:
75+
if 'prefix' in info and info['prefix'] is not None:
7676
config.prefix = info['prefix']
77-
if 'swift_install' in info:
77+
if 'swift_install' in info and info['swift_install'] is not None:
7878
config.swift_install = info['swift_install']
79-
if 'clang' in info:
79+
if 'clang' in info and info['clang'] is not None:
8080
config.clang = info['clang']
81-
if 'clangxx' in info:
81+
if 'clangxx' in info and info['clangxx'] is not None:
8282
config.clangxx = info['clangxx']
83-
if 'swift' in info:
83+
if 'swift' in info and info['swift'] is not None:
8484
config.swift = info['swift']
85-
if 'swiftc' in info:
85+
if 'swiftc' in info and info['swiftc'] is not None:
8686
config.swiftc = info['swiftc']
87-
if 'ar' in info:
87+
if 'ar' in info and info['ar'] is not None:
8888
config.ar = info['ar']
89-
if 'swift_sdk' in info:
89+
if 'swift_sdk' in info and info['swift_sdk'] is not None:
9090
config.swift_sdk = info['swift_sdk']
91-
if 'bootstrap_directory' in info:
91+
if 'bootstrap_directory' in info and info['bootstrap_directory'] is not None:
9292
config.bootstrap_directory = Path(info['bootstrap_directory'])
93-
if 'verbose' in info:
93+
if 'verbose' in info and info['verbose'] is not None:
9494
config.verbose = info['verbose']
95-
if 'extra_c_flags' in info:
95+
if 'extra_c_flags' in info and info['extra_c_flags'] is not None:
9696
config.extra_c_flags = info['extra_c_flags']
97-
if 'extra_swift_flags' in info:
97+
if 'extra_swift_flags' in info and info['extra_swift_flags'] is not None:
9898
config.extra_swift_flags = info['extra_swift_flags']
99-
if 'extra_ld_flags' in info:
99+
if 'extra_ld_flags' in info and info['extra_ld_flags'] is not None:
100100
config.extra_ld_flags = info['extra_ld_flags']
101-
if 'build_mode' in info:
101+
if 'build_mode' in info and info['build_mode'] is not None:
102102
config.build_mode = info['build_mode']
103-
if 'variables' in info:
103+
if 'variables' in info and info['variables'] is not None:
104104
config.variables = info['variables']
105105
else:
106106
sys.exit("invalid version")

0 commit comments

Comments
 (0)