Fix caching by preserving all file stats when pushing to device or cloud

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2020-05-19 12:14:09 +01:00
parent a21d3fe2d2
commit 77f3fa4b6c
2 changed files with 8 additions and 2 deletions

View File

@ -228,7 +228,12 @@ function originalTarDirectory(dir, param) {
readFile(file),
(filename, stats, data) =>
pack.entry(
{ name: toPosixPath(filename), size: stats.size, mode: stats.mode },
{
name: toPosixPath(filename),
mtime: stats.mtime,
size: stats.size,
mode: stats.mode,
},
data,
),
);

View File

@ -189,8 +189,9 @@ export async function tarDirectory(
pack.entry(
{
name: toPosixPath(fileStats.relPath),
size: fileStats.stats.size,
mtime: fileStats.stats.mtime,
mode: fileStats.stats.mode,
size: fileStats.stats.size,
},
await readFile(fileStats.filePath),
);