How would you write a Fabric script that uncomments the line
#force_color_prompt=yes
from the logged-in user's .bashrc file?
Note: This question is specifically about editing this particular line, not about simply appending force_color_prompt=yes to the end of the file and ignoring this line.
fabric do have api for that. fabric.contrib.files.uncomment
from fabric.contrib.files import uncomment
uncomment("~/.bashrc", "^#force_color_prompt=yes", char='#')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With