feat(analysis): add overwrite protection

This commit is contained in:
Hugo Pointcheval 2022-12-12 21:38:57 -05:00
parent 7f9621b4f6
commit 29d8ec640f
Signed by: hugo
GPG Key ID: A9E8E9615379254F

View File

@ -63,6 +63,18 @@ if [ ! -e "$OLD_OPTIONS_FLUTTER" ]; then
exit 1 exit 1
fi fi
if [ -e "$NEW_OPTIONS" ]; then
echo "analysis_options.${new}.yaml already exists"
echo "${usage}"
exit 1
fi
if [ -e "$NEW_OPTIONS_FLUTTER" ]; then
echo "analysis_options.flutter.${old}.yaml already exists"
echo "${usage}"
exit 1
fi
# Copy previous version files # Copy previous version files
cp "${OLD_OPTIONS}" "${NEW_OPTIONS}" cp "${OLD_OPTIONS}" "${NEW_OPTIONS}"
cp "${OLD_OPTIONS_FLUTTER}" "${NEW_OPTIONS_FLUTTER}" cp "${OLD_OPTIONS_FLUTTER}" "${NEW_OPTIONS_FLUTTER}"