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)