Skip to content

Commit e7a7892

Browse files
committed
Fix #141: Fields that nw.js renamed weren't handled properly
1 parent 48ace7c commit e7a7892

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

command_line.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,19 @@ def get_setting(self, name):
370370
Returns:
371371
A setting object or None
372372
"""
373+
# Check for alternate names in the settings
374+
# due to nw.js changing some names in newer versions
375+
name_no_underscores = name.replace('_', '-')
376+
373377
for setting_group in (self.settings['setting_groups'] +
374378
[self.settings['export_settings']] +
375379
[self.settings['compression']]):
376380
if name in setting_group:
377381
setting = setting_group[name]
378382
return setting
383+
elif name_no_underscores in setting_group:
384+
setting = setting_group[name_no_underscores]
385+
return setting
379386

380387
def get_settings_type(self, type):
381388
"""Get all settings with a specific type"""
@@ -506,7 +513,7 @@ def load_package_json(self, json_path=None):
506513
p_json = [json_path]
507514
else:
508515
p_json = glob.glob(utils.path_join(self.project_dir(),
509-
'package.json'))
516+
'package.json'))
510517
setting_list = []
511518

512519
if p_json:

0 commit comments

Comments
 (0)