将本脚本保存为 文件名.sh
, 然后再为该文件添加运行权限, 即可方便在项目中使用 carthage:
#!/usr/bin/env sh
if ! command -v carthage > /dev/null; then
printf 'Carthage is not installed.\n'
printf 'See https://github.com/Carthage/Carthage for install instructions.\n'
exit 1
fi
carthage update --platform iOS --no-use-binaries --cache-builds