bfg-common 1.2.12 → 1.2.13
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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineNuxtModule } from '@nuxt/kit'
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
5
|
+
const npmGenerate = (): void => {
|
|
6
|
+
// Переносим весь контент и удаляем все файлы кроме картинок
|
|
7
|
+
const folderPath = path.join(
|
|
8
|
+
__dirname.replace('/modules/fixSpiceConsole', ''),
|
|
9
|
+
'public',
|
|
10
|
+
'spice-console'
|
|
11
|
+
)
|
|
12
|
+
if (!fs.existsSync(folderPath)) return
|
|
13
|
+
|
|
14
|
+
fs.rmdir(folderPath, { recursive: true }, (err: any) => {
|
|
15
|
+
if (err) {
|
|
16
|
+
console.error('Error while removing folder:', err);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export default defineNuxtModule(() => {
|
|
23
|
+
switch (process.env.npm_command) {
|
|
24
|
+
case 'exec':
|
|
25
|
+
npmGenerate()
|
|
26
|
+
break
|
|
27
|
+
}
|
|
28
|
+
})
|