From 878fe18798555e28a49f94c276ab237ec90f4ed5 Mon Sep 17 00:00:00 2001 From: Victor Rachieru Date: Mon, 18 Apr 2016 22:16:08 +0300 Subject: [PATCH] Fix symlink issue It seems that sublime has a little issue with symlinks such that it doesn't detect that the content changed. In order to bypass this, every time I refresh the local database file I recreate the symlink as well. Hackish.. but it works --- cheatsheet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cheatsheet.py b/cheatsheet.py index 5b7d213..2a78588 100644 --- a/cheatsheet.py +++ b/cheatsheet.py @@ -107,5 +107,6 @@ def saveCheatsheetCommands(self): json.dump(self.commands, output, sort_keys = True, indent = 2, separators = (',', ': ')) def symlinkCommandsFile(self): - if not os.path.islink(_localCommandsFileSymlink): - os.symlink(_localCommandsFile, _localCommandsFileSymlink) + if os.path.exists(_localCommandsFileSymlink): + os.remove(_localCommandsFileSymlink) + os.symlink(_localCommandsFile, _localCommandsFileSymlink)