# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1725032500 -7200
# Node ID 0ef9c26d9d965162c3410eb280dfb945b426114a
# Parent  2fb79fe5439051db94d9de3e1152bac8bd89209a
util.prosodyctl.cert: Ensure old cert is moved out of the way

This should make it visible if the move fails

diff -r 2fb79fe54390 -r 0ef9c26d9d96 util/prosodyctl/cert.lua
--- a/util/prosodyctl/cert.lua	Sun Aug 18 16:58:30 2024 +0200
+++ b/util/prosodyctl/cert.lua	Fri Aug 30 17:41:40 2024 +0200
@@ -163,7 +163,7 @@
 	local attrs = lfs.attributes(to);
 	if attrs then -- Move old file out of the way
 		local backup = to..".bkp~"..os.date("%FT%T", attrs.change);
-		os.rename(to, backup);
+		assert(os.rename(to, backup));
 	end
 	-- FIXME friendlier error handling, maybe move above backup back?
 	local input = assert(io.open(from));