1
0
Fork 0
mirror of synced 2024-11-22 08:15:34 -05:00

Updated Tips and Tricks (markdown)

dagadbm 2018-06-03 20:12:57 +01:00
parent b032cee9c7
commit 6b6376689b

@ -164,3 +164,29 @@ This works best if you use public key authentication (or GSSAPI/Kerberos authent
# Automatically update your Dotbot config file when you add files in Git
You can use this tool (implemented as a Git pre-commit hook) to automatically update Dotbot's config file when adding files in Git: https://github.com/gwerbin/dotbot-autobot.
# Uninstall script
Currently, dotbot does not support uninstalling the symlinks. This scirpt is a good starting point for people who want this feature ([source](https://github.com/anishathalye/dotbot/issues/152#issuecomment-394129600))
```python
#!/usr/bin/env python
from __future__ import print_function
import yaml
import os
CONFIG="install.conf.yaml"
stream = open(CONFIG, "r")
conf = yaml.load(stream)
for section in conf:
if 'link' in section:
for target in section['link']:
realpath = os.path.expanduser(target)
if os.path.islink(realpath):
print("Removing ", realpath)
os.unlink(realpath)
```