Mac的brew包和pip第三方包自动升级脚本

最近搞了一个MAC,但是因为安装的第三方包都需要手动升级,就有点烦。

搞了个批量升级脚本,可以用来参考使用。

pip批量升级脚本

import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)

  

升级brew、docker images和pip包

import pip
import os
from subprocess import call

os.system("brew update")
os.system("docker images | awk '{print $1}' | grep -v 'none' | grep -iv 'repo' | xargs -n1 docker pull")
for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)

  

posted @ 2018-06-24 19:55  熊吉Devops  阅读(336)  评论(0编辑  收藏  举报