aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/build/generate-sri.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-05-10 14:21:36 +0200
committerMario Vavti <mario@mariovavti.com>2019-05-10 14:21:36 +0200
commit9866053f0ce44721c11990c9f9407e7428757c99 (patch)
tree6e414efa36c3bda00205918cecb9122f951427e3 /vendor/twbs/bootstrap/build/generate-sri.js
parent89a2c1a09c896ac3a23df26a1783f5c682188a56 (diff)
downloadvolse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.tar.gz
volse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.tar.bz2
volse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.zip
update bootstrap to version 4.3.1
Diffstat (limited to 'vendor/twbs/bootstrap/build/generate-sri.js')
-rw-r--r--vendor/twbs/bootstrap/build/generate-sri.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/vendor/twbs/bootstrap/build/generate-sri.js b/vendor/twbs/bootstrap/build/generate-sri.js
index 10936e8a1..a93f3e538 100644
--- a/vendor/twbs/bootstrap/build/generate-sri.js
+++ b/vendor/twbs/bootstrap/build/generate-sri.js
@@ -5,18 +5,20 @@
* Remember to use the same vendor files as the CDN ones,
* otherwise the hashes won't match!
*
- * Copyright 2017-2018 The Bootstrap Authors
- * Copyright 2017-2018 Twitter, Inc.
+ * Copyright 2017-2019 The Bootstrap Authors
+ * Copyright 2017-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
+const crypto = require('crypto')
const fs = require('fs')
const path = require('path')
-const sriToolbox = require('sri-toolbox')
const sh = require('shelljs')
+const pkg = require('../package.json')
+
sh.config.fatal = true
const configFile = path.join(__dirname, '../_config.yml')
@@ -34,11 +36,15 @@ const files = [
configPropertyName: 'js_hash'
},
{
- file: 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js',
+ file: 'dist/js/bootstrap.bundle.min.js',
+ configPropertyName: 'js_bundle_hash'
+ },
+ {
+ file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`,
configPropertyName: 'jquery_hash'
},
{
- file: 'site/docs/4.1/assets/js/vendor/popper.min.js',
+ file: 'node_modules/popper.js/dist/umd/popper.min.js',
configPropertyName: 'popper_hash'
}
]
@@ -49,9 +55,9 @@ files.forEach((file) => {
throw err
}
- const integrity = sriToolbox.generate({
- algorithms: ['sha384']
- }, data)
+ const algo = 'sha384'
+ const hash = crypto.createHash(algo).update(data, 'utf8').digest('base64')
+ const integrity = `${algo}-${hash}`
console.log(`${file.configPropertyName}: ${integrity}`)