Skip to content

Instantly share code, notes, and snippets.

@wafer-li
Created January 11, 2018 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wafer-li/4f334667b444b5a0a617d75936a9535a to your computer and use it in GitHub Desktop.
Save wafer-li/4f334667b444b5a0a617d75936a9535a to your computer and use it in GitHub Desktop.
Python script to update all hexo-next plugins
#!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