Skip to content

Commit

Permalink
Fix cache folder issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggordan committed Feb 21, 2014
1 parent 62cc3b3 commit dacad10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gutter_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def plugin_loaded():
# The maximum amount of space to take up
limit = 5242880 # 5 MB

# Get the size of the cache folder
size = sum(getsize(join(icon_path, f)) for f in listdir(icon_path) if isfile(join(icon_path, f)))
if exists(icon_path):
size = sum(getsize(join(icon_path, f)) for f in listdir(icon_path) if isfile(join(icon_path, f)))
if size > limit: rmtree(icon_path)

if size > limit: rmtree(icon_path)
if not exists(icon_path): makedirs(icon_path)

class GutterColorEventListener(EventListener):
Expand Down

0 comments on commit dacad10

Please sign in to comment.