Created
January 11, 2018 09:51
-
-
Save wafer-li/4f334667b444b5a0a617d75936a9535a to your computer and use it in GitHub Desktop.
Python script to update all hexo-next plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/env python3 | |
import os | |
from subprocess import call | |
from typing import List | |
if __name__ == '__main__': | |
root_dir = os.path.abspath('themes/next-reloaded/source/lib') | |
git_dirs: List[str] = [] | |
for dir_path, dir_names, files in os.walk(root_dir): | |
if '.git' in dir_names: | |
git_dirs.append(dir_path) | |
for git_dir in git_dirs: | |
os.chdir(git_dir) | |
print(os.path.basename(git_dir)) | |
call(['git', 'pull']) | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment