Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您将如何编写取消注释该行的 Fabric 脚本
#force_color_prompt=yes
来自登录用户的 .bashrc 文件?
注意:此问题专门针对编辑此特定行,而不是简单地将 force_color_prompt=yes 附加到文件末尾并忽略此行。
织物确实有 api。fabric.contrib.files.uncomment
fabric.contrib.files.uncomment
from fabric.contrib.files import uncomment uncomment("~/.bashrc", "^#force_color_prompt=yes", char='#')