Skip to content

Commit

Permalink
Add ability to old settings file on Unix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
mandeep committed Apr 17, 2018
1 parent 4409580 commit c397f67
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ class CondaCommand(sublime_plugin.WindowCommand):

@property
def settings(self):
"""Load the plugin settings for commands to use."""
"""Load the plugin settings for commands to use.
For Unix systems, the plugin will first try to load the old settings
file with the base name 'conda.sublime-settings'. If this file can't
be accessed the plugin will set the settings file to
the new settings file named 'Conda.sublime-settings'.
"""
if sys.platform.startswith('win'):
return sublime.load_settings('Conda (Windows).sublime-settings')
else:
return sublime.load_settings('Conda.sublime-settings')
try:
settings = sublime.load_settings('conda.sublime-settings')
# sublime text doesn't tell us if the settings file exists unless we try to access it
os.path.expanduser(settings.get('environment_directory'))
except AttributeError:
settings = sublime.load_settings('Conda.sublime-settings')

return settings

@property
def executable(self):
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"0.4.3": "messages/v0.4.3.txt",
"0.4.4": "messages/v0.4.4.txt",
"0.4.5": "messages/v0.4.5.txt",
"0.4.6": "messages/v0.4.6.txt"
"0.4.6": "messages/v0.4.6.txt",
"0.5.0": "messages/v0.5.0.txt"
}
5 changes: 5 additions & 0 deletions messages/v0.5.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Conda v0.5.0
============

- Added the ability to load old settings files on Unix based systems
- Incremented minor version as the new settings file system could cause minor breakage

0 comments on commit c397f67

Please sign in to comment.