@@ -48,59 +48,59 @@ def reconfigure(config, path):
48
48
with open (path , 'r' ) as infile :
49
49
info = json .load (infile )
50
50
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 :
52
52
config .command = info ['command' ]
53
- if 'project' in info :
53
+ if 'project' in info and info [ 'project' ] is not None :
54
54
config .command = info ['project' ]
55
- if 'script_path' in info :
55
+ if 'script_path' in info and info [ 'script_path' ] is not None :
56
56
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 :
58
58
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 :
60
60
config .source_root = Path (info ['source_root' ])
61
- if 'target' in info :
61
+ if 'target' in info and info [ 'target' ] is not None :
62
62
config .target = Target (info ['target' ])
63
- if 'system_root' in info :
63
+ if 'system_root' in info and info [ 'system_root' ] is not None :
64
64
config .system_root = Path (info ['system_root' ])
65
- if 'toolchain' in info :
65
+ if 'toolchain' in info and info [ 'toolchain' ] is not None :
66
66
config .toolchain = info ['toolchain' ]
67
- if 'build_directory' in info :
67
+ if 'build_directory' in info and info [ 'build_directory' ] is not None :
68
68
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 :
70
70
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 :
72
72
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 :
74
74
config .install_directory = Path (info ['install_directory' ])
75
- if 'prefix' in info :
75
+ if 'prefix' in info and info [ 'prefix' ] is not None :
76
76
config .prefix = info ['prefix' ]
77
- if 'swift_install' in info :
77
+ if 'swift_install' in info and info [ 'swift_install' ] is not None :
78
78
config .swift_install = info ['swift_install' ]
79
- if 'clang' in info :
79
+ if 'clang' in info and info [ 'clang' ] is not None :
80
80
config .clang = info ['clang' ]
81
- if 'clangxx' in info :
81
+ if 'clangxx' in info and info [ 'clangxx' ] is not None :
82
82
config .clangxx = info ['clangxx' ]
83
- if 'swift' in info :
83
+ if 'swift' in info and info [ 'swift' ] is not None :
84
84
config .swift = info ['swift' ]
85
- if 'swiftc' in info :
85
+ if 'swiftc' in info and info [ 'swiftc' ] is not None :
86
86
config .swiftc = info ['swiftc' ]
87
- if 'ar' in info :
87
+ if 'ar' in info and info [ 'ar' ] is not None :
88
88
config .ar = info ['ar' ]
89
- if 'swift_sdk' in info :
89
+ if 'swift_sdk' in info and info [ 'swift_sdk' ] is not None :
90
90
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 :
92
92
config .bootstrap_directory = Path (info ['bootstrap_directory' ])
93
- if 'verbose' in info :
93
+ if 'verbose' in info and info [ 'verbose' ] is not None :
94
94
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 :
96
96
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 :
98
98
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 :
100
100
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 :
102
102
config .build_mode = info ['build_mode' ]
103
- if 'variables' in info :
103
+ if 'variables' in info and info [ 'variables' ] is not None :
104
104
config .variables = info ['variables' ]
105
105
else :
106
106
sys .exit ("invalid version" )
0 commit comments