aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/build/generate-sri.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/build/generate-sri.js')
-rw-r--r--vendor/twbs/bootstrap/build/generate-sri.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/twbs/bootstrap/build/generate-sri.js b/vendor/twbs/bootstrap/build/generate-sri.js
index 1c8050f6e..2e2292475 100644
--- a/vendor/twbs/bootstrap/build/generate-sri.js
+++ b/vendor/twbs/bootstrap/build/generate-sri.js
@@ -18,11 +18,11 @@ const sh = require('shelljs')
sh.config.fatal = true
-const configFile = path.join(__dirname, '../config.yml')
+const configFile = path.join(__dirname, '../hugo.yml')
// Array of objects which holds the files to generate SRI hashes for.
// `file` is the path from the root folder
-// `configPropertyName` is the config.yml variable's name of the file
+// `configPropertyName` is the hugo.yml variable's name of the file
const files = [
{
file: 'dist/css/bootstrap.min.css',
@@ -46,8 +46,8 @@ const files = [
}
]
-for (const file of files) {
- fs.readFile(file.file, 'utf8', (error, data) => {
+for (const { file, configPropertyName } of files) {
+ fs.readFile(file, 'utf8', (error, data) => {
if (error) {
throw error
}
@@ -56,8 +56,8 @@ for (const file of files) {
const hash = crypto.createHash(algo).update(data, 'utf8').digest('base64')
const integrity = `${algo}-${hash}`
- console.log(`${file.configPropertyName}: ${integrity}`)
+ console.log(`${configPropertyName}: ${integrity}`)
- sh.sed('-i', new RegExp(`^(\\s+${file.configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
+ sh.sed('-i', new RegExp(`^(\\s+${configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
})
}