Skip to content

Commit

Permalink
Fixes folder timestamps being updated before copying files into them (#…
Browse files Browse the repository at this point in the history
…2964)

* When updating the timestamps were requested, scanCopy first set the times and then copied content into the destination folder. On certain platforms, copying files into a folder updates its "Last Access Time" and that overwrites the just set timestamps. This PR, makes sure the timestamps are set only after copying the content.

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 5dc0212)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
github-actions[bot] committed Nov 30, 2022
1 parent 21a9e7f commit 30fad69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dev/build/lib/scan_copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ export async function scanCopy(options: Options) {
await copyFileAsync(record.absolute, record.absoluteDest, Fs.constants.COPYFILE_EXCL);
}

if (time) {
await utimesAsync(record.absoluteDest, time, time);
}

if (record.isDirectory) {
await copyChildren(record);
}

if (time) {
await utimesAsync(record.absoluteDest, time, time);
}
};

await mkdirp(destination);
Expand Down

0 comments on commit 30fad69

Please sign in to comment.