-
-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One of the steps to help fixing various kinds of issues is to ask users to delete the "$DATA/Cache" directory. This commit adds a command to simplify that step.
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import sublime | ||
import sublime_plugin | ||
|
||
from ..clear_directory import clear_directory | ||
from ..show_error import show_message | ||
from ..sys_path import cache_path, shortpath | ||
|
||
|
||
class ClearPackageCacheCommand(sublime_plugin.ApplicationCommand): | ||
|
||
""" | ||
A command that clears out ST's Cache directory. | ||
""" | ||
|
||
def run(self): | ||
folder = cache_path() | ||
display_folder = shortpath(folder) | ||
|
||
if not sublime.ok_cancel_dialog( | ||
msg='Do you want to clear "{}" to reset all packages ' "to freshly installed state?".format(display_folder), | ||
title="Clear Sublime Text Cache Directory?", | ||
): | ||
return | ||
|
||
if clear_directory(folder, ignore_errors=False): | ||
show_message( | ||
""" | ||
"%s" has been cleared. | ||
You might need to restart Sublime Text for changes to take effect. | ||
""", | ||
display_folder, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters