mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(setup): verify published configuration content during uninstall
Require publication readback in the owning check so in-place edits are detected and preserved with the original backup.
This commit is contained in:
1 parent
82fd223638
commit
030fa886f9
4 files changed
+43
-9
No files matched your search
@@ -169,12 +169,12 @@ export class ClientConfigurationPublication {
|
||||
return outcome.value;
|
||||
}
|
||||
|
||||
async assertCurrent(readback?: string): Promise<void> {
|
||||
async assertCurrent(readback: string): Promise<void> {
|
||||
const owned = await this.owner.handle.stat();
|
||||
const named = await lstat(this.path);
|
||||
if (
|
||||
owned.ino === 0 ||
|
||||
(readback !== undefined && readback !== this.contents) ||
|
||||
readback !== this.contents ||
|
||||
named.isSymbolicLink() ||
|
||||
!sameRegularFileState(owned, named)
|
||||
)
|
||||
|
||||
@@ -963,11 +963,9 @@ const removeClient = async (
|
||||
try {
|
||||
return await publication.verify(async () => {
|
||||
try {
|
||||
const readback = parseClientConfiguration(
|
||||
await fileSystem.readText(publication.path),
|
||||
client.format,
|
||||
);
|
||||
await publication.assertCurrent();
|
||||
const text = await fileSystem.readText(publication.path);
|
||||
await publication.assertCurrent(text);
|
||||
const readback = parseClientConfiguration(text, client.format);
|
||||
if (
|
||||
(removeNative && Object.hasOwn(readback.servers, name)) ||
|
||||
(readback.dialect === "dsh" &&
|
||||
|
||||
Reference in new issue
Block a user