mirror of
https://github.com/VSCodium/versions.git
synced 2025-12-10 03:54:07 -06:00
Add travis file to catch version mismatches sooner
This commit is contained in:
parent
f8003371e8
commit
f04a4d2497
3
.travis.yml
Normal file
3
.travis.yml
Normal file
@ -0,0 +1,3 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "node"
|
||||
@ -70,7 +70,7 @@ function compareSums (sums, json) {
|
||||
}
|
||||
|
||||
|
||||
async function validateAssets () {
|
||||
async function validateAssets (throwErrors = false) {
|
||||
const results = {}
|
||||
for (let type in TYPES) {
|
||||
console.log('Checking', type, '...')
|
||||
@ -81,11 +81,13 @@ async function validateAssets () {
|
||||
console.log('Downloaded asset. Computing sums ...')
|
||||
const sums = await getSums(file)
|
||||
const valid = compareSums(sums, json)
|
||||
if (!valid && throwErrors) throw new Error(`Invalid hashes for ${type} ${json.productVersion}`)
|
||||
results[type] = valid
|
||||
? `Hashes match (${json.productVersion})`
|
||||
: `Invalid hashes (${json.productVersion})`
|
||||
console.log(results[type])
|
||||
} catch (e) {
|
||||
if (throwErrors) throw e
|
||||
console.log('Encountered an error, skipping ...')
|
||||
results[type] = `Error: ${e.message}`
|
||||
}
|
||||
@ -94,4 +96,4 @@ async function validateAssets () {
|
||||
console.log(JSON.stringify(results, null, 4))
|
||||
}
|
||||
|
||||
validateAssets()
|
||||
validateAssets(process.argv[2] === 'test')
|
||||
|
||||
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "vscodium-versions",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"test": "node integrity.js test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vscodium/versions"
|
||||
},
|
||||
"author": {
|
||||
"name": "Peter Squicciarini",
|
||||
"email": "stripedpajamas273@gmail.com"
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user