We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
git-snapshots
1 parent 7458a8d commit 40c25e3Copy full SHA for 40c25e3
adjust-hrefs.js
@@ -0,0 +1,22 @@
1
+#!/usr/bin/env node
2
+
3
+(async () => {
4
+ const fs = require('fs')
5
+ const lines = fs.readFileSync('index.html', 'utf-8').split('\n')
6
7
+ let tagName
8
+ for (let i = 0; i < lines.length; i++) {
9
+ const match = lines[i].match(/href="(?!GitForWindows\.css|mailto:)(Git-(.*)-64-bit\.exe|[^"\/]+)"/)
10
+ if (!match) continue
11
+ if (match[2]) tagName = match[2]
12
+ lines[i] = lines[i].replace(
13
+ /href="([^"\/]+)"/g,
14
+ `href="https://github.com/git-for-windows/git-snapshots/releases/download/${tagName}/$1"`
15
+ )
16
+ }
17
18
+ fs.writeFileSync('index.html', lines.join('\n'))
19
+})().catch(e => {
20
+ console.error(e)
21
+ process.exit(1)
22
+})
0 commit comments