1 Star 0 Fork 17

cuiqitao/GMCORE

forked from 董理/GMCORE 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pull_libs.py 969 Bytes
一键复制 编辑 原始数据 按行查看 历史
董理 提交于 2024-01-01 10:27 . Add lib rrtmgp
#!/usr/bin/env python3
import argparse
import os
import subprocess
parser = argparse.ArgumentParser(description='Pulls all or some submodules from external repositories.')
parser.add_argument('--libs', nargs='+', help='The libraries to pull.', choices=('noahmp','rrtmgp'), default=[])
args = parser.parse_args()
def run(cmd):
print(f'==> {cmd}')
res = subprocess.run(cmd, shell=True, check=True)
def pull(lib_path, recursive=False):
if recursive:
cmd = f'git submodule update --recursive --init {lib_path}'
else:
cmd = f'git submodule update --init {lib_path}'
run(cmd)
pull('lib/container')
pull('lib/datetime')
pull('lib/fiona')
pull('lib/flogger')
pull('lib/string')
project_root = os.getcwd()
if 'noahmp' in args.libs:
pull('lib/noahmp')
os.chdir('lib/noahmp')
run('git apply ../noahmp.diff')
os.chdir(project_root)
if 'rrtmgp' in args.libs:
pull('lib/rrtmgp')
os.chdir('lib/rrtmgp')
run('git apply ../rrtmgp.diff')
os.chdir(project_root)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cuiqitao/GMCORE.git
git@gitee.com:cuiqitao/GMCORE.git
cuiqitao
GMCORE
GMCORE
master

搜索帮助