bfg-common 1.1.29 → 1.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,19 +51,13 @@ const npmGenerate = (): void => {
|
|
|
51
51
|
)
|
|
52
52
|
fs.cp(contentPath, publicPath, { recursive: true }, () => {
|
|
53
53
|
// Удаляем все файлы кроме картинок
|
|
54
|
-
console.log('removeNonImageFiles start');
|
|
55
54
|
removeNonImageFiles(publicPath)
|
|
56
|
-
console.log('removeNonImageFiles end');
|
|
57
55
|
|
|
58
56
|
// Удаляем картинки из папки content
|
|
59
|
-
console.log('removeImagesFromContent start');
|
|
60
57
|
removeImagesFromContent(contentPath)
|
|
61
|
-
console.log('removeImagesFromContent end');
|
|
62
58
|
|
|
63
59
|
// Правим путь к картинкам и заменяем кастомные тэги
|
|
64
|
-
console.log('updateImagesPathAndCustomComponents start');
|
|
65
60
|
updateImagesPathAndCustomComponents(contentPath)
|
|
66
|
-
console.log('updateImagesPathAndCustomComponents end');
|
|
67
61
|
})
|
|
68
62
|
// End block
|
|
69
63
|
}
|
|
@@ -88,31 +88,25 @@ export const replaceFileContent = async (
|
|
|
88
88
|
searchString: string | RegExp,
|
|
89
89
|
replacementString: any
|
|
90
90
|
): Promise<void> => {
|
|
91
|
-
console.log(filePath, 333, 'replaceFileContent');
|
|
92
91
|
return new Promise((resolve, reject) => {
|
|
93
92
|
fs.readFile(filePath, 'utf8', (err: any, data: string) => {
|
|
94
93
|
if (err) {
|
|
95
|
-
console.log('replaceFileContent reject 1');
|
|
96
94
|
reject()
|
|
97
95
|
return console.log(err)
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
if (data.match(replacementString)) {
|
|
101
|
-
console.log('replaceFileContent, resolve 1');
|
|
102
99
|
resolve()
|
|
103
100
|
return
|
|
104
101
|
}
|
|
105
102
|
|
|
106
103
|
const updatedContent = data.replace(searchString, replacementString)
|
|
107
|
-
console.log(updatedContent, 333, 'updatedContent');
|
|
108
104
|
|
|
109
105
|
fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
|
|
110
106
|
if (err) {
|
|
111
|
-
console.log('replaceFileContent reject 2');
|
|
112
107
|
reject()
|
|
113
108
|
return console.log(err)
|
|
114
109
|
}
|
|
115
|
-
console.log('replaceFileContent, resolve 2');
|
|
116
110
|
resolve()
|
|
117
111
|
})
|
|
118
112
|
})
|