Skip to content

Commit 3c9127d

Browse files
authored
refreshing setup scripts to address upstream changes (desktop#214)
* octokit deprecated old way of authenticating * ensure submodule exists before fetching tags * added better tracing for finding release notes checksums when error occurs * tweak regex * these are coming from the checksums file
1 parent b2b4175 commit 3c9127d

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

dependencies.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,37 @@
1919
]
2020
},
2121
"git-lfs": {
22-
"version": "v2.6.1",
22+
"version": "v2.7.1",
2323
"files": [
2424
{
2525
"platform": "darwin",
2626
"arch": "amd64",
27-
"name": "git-lfs-darwin-amd64-v2.6.1.tar.gz",
28-
"checksum": "84ac4953c55bbaf87efd1c3d5b7778b1cf0b257025d2a86d709a2bf301c32c8b"
27+
"name": "git-lfs-darwin-amd64-v2.7.1.tar.gz",
28+
"checksum": "16653c7aefd5b7fb040db675dc0a9983d78a914bafc22940d938bcce7bf9b649"
2929
},
3030
{
3131
"platform": "linux",
3232
"arch": "amd64",
33-
"name": "git-lfs-linux-amd64-v2.6.1.tar.gz",
34-
"checksum": "c098092be413915793214a570cd51ef46089b6f6616b2f78e35ba374de613b5b"
33+
"name": "git-lfs-linux-amd64-v2.7.1.tar.gz",
34+
"checksum": "7be85238cbbb957ab25de52b60279d40ba40d3faa72eeb2cb9fa77d6d92381e5"
3535
},
3636
{
3737
"platform": "linux",
3838
"arch": "arm64",
39-
"name": "git-lfs-linux-arm64-v2.6.1.tar.gz",
40-
"checksum": "5624ca015537333b459fa3817da7257a73ed612d958eccc596e6118b4bf6a5c6"
39+
"name": "git-lfs-linux-arm64-v2.7.1.tar.gz",
40+
"checksum": "16a37788348759284f6b5af50fab6a591ef70df0dfe85c97074873b6c5f82471"
4141
},
4242
{
4343
"platform": "windows",
4444
"arch": "x86",
45-
"name": "git-lfs-windows-386-v2.6.1.zip",
46-
"checksum": "90bbeb7dc4ada394624d3a2675fd51dd4873753a56fb197b17bc01c9fcc91398"
45+
"name": "git-lfs-windows-386-v2.7.1.zip",
46+
"checksum": "5ce9466934b37a258aae07f19ba8a70cdeff75239fb66126e718a60cf2820ed8"
4747
},
4848
{
4949
"platform": "windows",
5050
"arch": "amd64",
51-
"name": "git-lfs-windows-amd64-v2.6.1.zip",
52-
"checksum": "35d0a62c5e36131b7ba65352146c585eaf1f33d7a229b9471082f49fca53b952"
51+
"name": "git-lfs-windows-amd64-v2.7.1.zip",
52+
"checksum": "5c12db9728b53cba23e5f58f4a53d88cb2132e82fa1de0f8a79ce9d112e4d396"
5353
}
5454
]
5555
},

git

Submodule git updated 465 files

script/update-git-lfs.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const path = require('path')
22
const fs = require('fs')
33
const Octokit = require('@octokit/rest')
4-
const octokit = new Octokit()
54
const rp = require('request-promise')
65

76
process.on('unhandledRejection', reason => {
@@ -65,10 +64,7 @@ async function run() {
6564
return
6665
}
6766

68-
octokit.authenticate({
69-
type: 'token',
70-
token,
71-
})
67+
const octokit = new Octokit({ auth: `token ${token}` })
7268

7369
const user = await octokit.users.getAuthenticated({})
7470
const me = user.data.login
@@ -128,11 +124,14 @@ async function run() {
128124
const newFiles = []
129125

130126
for (const file of files) {
131-
const re = new RegExp(`([0-9a-z]{64})\\s*${file}`)
127+
const re = new RegExp(`([0-9a-z]{64})\\s\\*${file}`)
132128
const match = re.exec(fileContents)
133129
const platform = getPlatform(file)
134130
if (match == null) {
135-
console.log(`🔴 Could not find entry for file ${platform}`)
131+
console.log(`🔴 Could not find entry for file '${file}'`)
132+
console.log(`🔴 SHA256 checksum contents:`)
133+
console.log(`${fileContents}`)
134+
console.log()
136135
} else {
137136
newFiles.push({
138137
platform,

script/update-git.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const path = require('path')
22
const fs = require('fs')
33
const ChildProcess = require('child_process')
44
const Octokit = require('@octokit/rest')
5-
const octokit = new Octokit()
65

76
const semver = require('semver')
87

@@ -46,6 +45,7 @@ function spawn(
4645
}
4746

4847
async function refreshGitSubmodule() {
48+
await spawn('git', ['submodule', 'update', '--init'], root)
4949
await spawn('git', ['fetch', '--tags'], gitDir)
5050
}
5151

@@ -140,10 +140,7 @@ async function run() {
140140
return
141141
}
142142

143-
octokit.authenticate({
144-
type: 'token',
145-
token,
146-
})
143+
const octokit = new Octokit({ auth: `token ${token}` })
147144

148145
const user = await octokit.users.getAuthenticated({})
149146
const me = user.data.login

0 commit comments

Comments
 (0)