From 0b265c5bc3599b828ac2963d62b73340f0149de4 Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 17 Jul 2023 19:14:08 -0300 Subject: [PATCH] invert layer order --- server/tar2squashfs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/tar2squashfs.js b/server/tar2squashfs.js index 336cda8..bff7a7f 100644 --- a/server/tar2squashfs.js +++ b/server/tar2squashfs.js @@ -48,7 +48,9 @@ export async function tar2squashfs(streams, output, extraFiles) { p.pipe(child.stdin); p.on("error", console.error); - for (const streamP of streams) { + // We reverse the arrays because mksquashfs ignores files if they already exist, + // so we leave the last layers first so they are the ones used instead of the last ones + for (const streamP of [...streams].reverse()) { const stream = await streamP; const ex = extract();