Skip to content

Commit

Permalink
Fix #141: Fields that nw.js renamed weren't handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jyapayne committed Jun 8, 2016
1 parent 48ace7c commit e7a7892
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,19 @@ def get_setting(self, name):
Returns:
A setting object or None
"""
# Check for alternate names in the settings
# due to nw.js changing some names in newer versions
name_no_underscores = name.replace('_', '-')

for setting_group in (self.settings['setting_groups'] +
[self.settings['export_settings']] +
[self.settings['compression']]):
if name in setting_group:
setting = setting_group[name]
return setting
elif name_no_underscores in setting_group:
setting = setting_group[name_no_underscores]
return setting

def get_settings_type(self, type):
"""Get all settings with a specific type"""
Expand Down Expand Up @@ -506,7 +513,7 @@ def load_package_json(self, json_path=None):
p_json = [json_path]
else:
p_json = glob.glob(utils.path_join(self.project_dir(),
'package.json'))
'package.json'))
setting_list = []

if p_json:
Expand Down

0 comments on commit e7a7892

Please sign in to comment.