Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit a374f33

Browse files
authored
Merge pull request #82 from typescript-tools/update-utime-of-downloaded-binary-after-installation
fix: update mtime of downloaded binary after installation
2 parents 21b3e1f + 6688b89 commit a374f33

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

npm/install.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ const linkBinaryIntoBin = () => {
2626
// If this fails and throws an error, we'll end up leaving the temporary file there,
2727
// which is harmless.
2828
fs.renameSync(tempPath, desiredPath)
29+
30+
// By default, the downloaded file preserves the mtime of the binary created by GitHub
31+
// Actions. For a seamless GNU Make experience on local machines, we want to update the
32+
// mtime of this binary to the time of download.
33+
const now = new Date()
34+
fs.utimesSync(desiredPath, now, now)
2935
}
3036

3137
// Downloaded binary to /bin/{ name }

0 commit comments

Comments
 (0)