Skip to content

Commit 6a922e3

Browse files
committed
bump-version: write also .url files for direct links
This change lets `bump-version.js` write out \`.url\` files so that e.g. https://gitforwindows.org/latest-64-bit-installer.url will return the direct link to the latest 64-bit Git for Windows downloader. Ideally, this would not just be a file returning the URL as static content, but instead redirect. However, that is currently not possible with GitHub Pages (which backs Git for Windows' home page). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 43ee46a commit 6a922e3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bump-version.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ var updateVersion = (version, tag, timestamp, url) => {
1919
+ timestamp + '">Version ' + version + '</a></div>';
2020
fs.writeFileSync('latest-version.txt', version);
2121
fs.writeFileSync('latest-tag.txt', tag);
22+
const urlPrefix = `https://github.com/git-for-windows/git/releases/download/${tag}`;
23+
for (const bitness of ['64', '32']) {
24+
fs.writeFileSync(`latest-${bitness}-bit-installer.url`,
25+
`${urlPrefix}/Git-${version}-${bitness}-bit.exe`);
26+
fs.writeFileSync(`latest-${bitness}-bit-portable-git.url`,
27+
`${urlPrefix}/PortableGit-${version}-${bitness}-bit.7z.exe`);
28+
fs.writeFileSync(`latest-${bitness}-bit-mingit.url`,
29+
`${urlPrefix}/MinGit-${version}-${bitness}-bit.zip`);
30+
}
2231
fs.readFile('index.html', 'utf8', (err, data) => {
2332
if (err)
2433
die(err);

0 commit comments

Comments
 (0)