# Here we assert that the buildId is the same as baseVersion's buildId and skip checking it separately
if [[ "$baseVersion" == "$INTERNAL_VERSION" && "$currentVersion" == "$INTERNAL_VERSION" ]]; then
echo "Version config file already up to date"
if [[ -w "$CONFIG_PATH" ]]; then
echo "Making existing version config file read-only"
chmod u-w "$CONFIG_PATH"
fi
exit 0
fi
if [[ ! -w "$CONFIG_PATH" ]]; then
echo "Making existing version config file writable temporarily"
chmod u+w "$CONFIG_PATH"
fi
fi
cat > "$CONFIG_PATH" << EOF
{
"_comment": "This file is managed by the qq-version-config.sh to disable auto updates, do not edit it manually. Set the `disableAutoUpdate` option to false to disable this behavior.",