加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
update_versions.sh 796 Bytes
一键复制 编辑 原始数据 按行查看 历史
Chris Craik 提交于 2018-10-11 15:51 . Fix update_versions to work on linux
#!/bin/bash
# Copies the master versions.gradle file to each sample, to make them
# compatible with Android Studio's "Import sample" feature.
for line in `find . -name 'gradlew'`
do
p=$(dirname "${line}");
echo "Copying versions.gradle -> ${p}";
cp versions.gradle "$p"
# remove the "ADMIN" line from the samples themselves
extraArg=""
if [[ $OSTYPE == darwin* ]]; then
# The macOS version of sed requires the backup file extension
# to be specified. Linux requires it not to be.
extraArg=".bak"
fi
sed -i $extraArg 's/.*\[ADMIN\].*//' $p/versions.gradle
cp gradle-wrapper.properties "$p/gradle/wrapper/."
done
# Remove the generated backup files
echo "Removing backup files"
# ignore output saying backups not found
find . -name '*.bak' | xargs rm 2> /dev/null
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化