mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 04:11:39 +02:00
Combine path and remove variable used in one place. (#24873)
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const sh = require('shelljs')
|
||||
|
||||
sh.config.fatal = true
|
||||
const sed = sh.sed
|
||||
|
||||
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
||||
RegExp.quote = (string) => string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
|
||||
@@ -58,7 +58,7 @@ function replaceRecursively(directory, excludedDirectories, allowedExtensions, o
|
||||
replacement = RegExp.quoteReplacement(replacement)
|
||||
const updateFile = !DRY_RUN ? (filepath) => {
|
||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||
sed('-i', original, replacement, filepath)
|
||||
sh.sed('-i', original, replacement, filepath)
|
||||
}
|
||||
} : (filepath) => {
|
||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||
|
Reference in New Issue
Block a user