如何在 Conan 配方中运行 'git submodule update'

如果你想在 conanfile.py 中运行 git submodule update,你可以在 git clone 命令之后简单添加 self.run() 命令:

conan_git_clone.py
self.run("git clone https://github.com/conan-io/hello.git")
self.run("cd hello && git submodule update --init --recursive")

完整示例:

conan_git_full.py
self.run("git clone https://github.com/seznam/elasticlient.git -b version-0.2")
self.run("cd elasticlient && git submodule update --init --recursive")

注意你需要 cd <目录> && git submodule update


Check out similar posts by category: C/C++, Conan