我有一个包含很多git repos的文件夹。我正在寻找一种方法来迭代所有的回购并使用bash函数做一些奇特的列表......
答案 0 :(得分:1)
根据the documentation,-c
的参数由/bin/sh
评估,因此如果您将花哨的函数放入名为functions.sh
的文件中,那么您可以执行某些操作像:
repo forall -c '. /path/to/functions.sh; myfunction'
假设您系统上的/bin/sh
实际上是Bash,或者如果不是:
repo forall -c 'bash -c ". /path/to/functions.sh; myfunction"'