diff --git a/src/register.jl b/src/register.jl index 4d13632..f6217fc 100644 --- a/src/register.jl +++ b/src/register.jl @@ -387,14 +387,8 @@ function update_deps_file(pkg::Project, end deps_data[pkg.version] = deps - if file == "Deps.toml" - # We always write the `Deps.toml` file, even if it is empty - write_this_file = true - else - # We only write the `WeakDeps.toml` file if it is not empty - write_this_file = !isempty(deps_data) && !all(isempty, values(deps_data)) - end - if write_this_file + if !isempty(deps_data) && !all(isempty, values(deps_data)) + # We intentionally do not write empty `Deps.toml` or `WeakDeps.toml` files Compress.save(deps_file, deps_data) end end @@ -498,14 +492,8 @@ function update_compat_file(pkg::Project, end compat_data[pkg.version] = d - if file == "Compat.toml" - # We always write the `Compat.toml` file, even if it is empty - write_this_file = true - else - # We only write the `WeakCompat.toml` file if it is not empty - write_this_file = !isempty(compat_data) && !all(isempty, values(compat_data)) - end - if write_this_file + if !isempty(compat_data) && !all(isempty, values(compat_data)) + # We intentionally do not write empty `Compat.toml` or `WeakCompat.toml` files Compress.save(compat_file, compat_data) end end