1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-02 01:42:36 +02:00

Enable unicorn/no-array-for-each rule

This commit is contained in:
XhmikosR
2021-07-30 09:28:51 +03:00
parent 2b4d0d166b
commit 666fe596bf
23 changed files with 132 additions and 117 deletions

View File

@@ -47,7 +47,7 @@ const files = [
}
]
files.forEach(file => {
for (const file of files) {
fs.readFile(file.file, 'utf8', (err, data) => {
if (err) {
throw err
@@ -61,4 +61,4 @@ files.forEach(file => {
sh.sed('-i', new RegExp(`^(\\s+${file.configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
})
})
}

View File

@@ -57,22 +57,22 @@ sh.mkdir('-p', [
sh.cp('-Rf', `${docsDir}/examples/*`, distFolder)
cssFiles.forEach(file => {
for (const file of cssFiles) {
sh.cp('-f', `${docsDir}/dist/css/${file}`, `${distFolder}/assets/dist/css/`)
})
}
jsFiles.forEach(file => {
for (const file of jsFiles) {
sh.cp('-f', `${docsDir}/dist/js/${file}`, `${distFolder}/assets/dist/js/`)
})
}
imgFiles.forEach(file => {
for (const file of imgFiles) {
sh.cp('-f', `${docsDir}/assets/brand/${file}`, `${distFolder}/assets/brand/`)
})
}
sh.rm(`${distFolder}/index.html`)
// get all examples' HTML files
sh.find(`${distFolder}/**/*.html`).forEach(file => {
for (const file of sh.find(`${distFolder}/**/*.html`)) {
const fileContents = sh.cat(file)
.toString()
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
@@ -81,7 +81,7 @@ sh.find(`${distFolder}/**/*.html`).forEach(file => {
.replace(/(<script src="\.\.\/.*) integrity=".*>/g, '$1></script>')
.replace(/( +)<!-- favicons(.|\n)+<style>/i, ' <style>')
new sh.ShellString(fileContents).to(file)
})
}
// create the zip file
sh.exec(`zip -r9 "${distFolder}.zip" "${distFolder}"`)