Updated Tips and Tricks (markdown)
parent
b032cee9c7
commit
6b6376689b
1 changed files with 27 additions and 1 deletions
|
@ -163,4 +163,30 @@ 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
|
# 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.
|
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)
|
||||||
|
```
|
Loading…
Reference in a new issue