jjb-cmd 2.2.3 → 2.2.5

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.
@@ -1,377 +1 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const os = require('os');
5
- const path = require('path');
6
- const utils = require('./util');
7
- const request = require('request');
8
- const compressing = require('compressing');
9
-
10
- // GIT仓库
11
- const GIT_HOST = 'http://192.168.1.242:10985';
12
- // 临时存放目录
13
- const GIT_TEMP_DIR = 'jjbAssembly';
14
- // 项目列表,后期可存库
15
- const CLOUD_PROJECT = {
16
- 'common': {
17
- token: 'G4HJRsHr9D7Ssmixegw2',
18
- projectId: 279,
19
- localName: 'common'
20
- },
21
- 'react-admin-component': {
22
- token: 'FT3pKzxpRynFkmddJ9Bs',
23
- projectId: 340,
24
- localName: 'components'
25
- }
26
- };
27
- // common 需要替换的文本(常规应用)
28
- const COMMON_CONTENT_NOR_REPLACE = [
29
- {
30
- path: `\\tools\\index.js`,
31
- replace: [
32
- [
33
- 'components',
34
- 'jjb-react-admin-component'
35
- ]
36
- ]
37
- },
38
- {
39
- path: `\\website\\index.js`,
40
- replace: [
41
- [
42
- /const\srelation\s=\srequire\(`~\/application\/\${module.code}\/enumerate\/menu`\)\.default;/,
43
- 'const relation = require(\'~/enumerate/menu\').default;'
44
- ],
45
- [
46
- 'components',
47
- 'jjb-react-admin-component'
48
- ]
49
- ]
50
- }
51
- ];
52
- // common 需要替换的文本(单应用)
53
- const COMMON_CONTENT_SPA_REPLACE = [
54
- {
55
- path: `\\tools\\index.js`,
56
- replace: [
57
- [
58
- 'return __planA();',
59
- 'return process.env;'
60
- ]
61
- ]
62
- }
63
- ];
64
- // common 需要替换的文本(微应用)
65
- const COMMON_CONTENT_MICRO_REPLACE = [
66
- {
67
- path: `\\tools\\index.js`,
68
- replace: [
69
- [
70
- 'return __planA();',
71
- 'return process.env.app;'
72
- ]
73
- ]
74
- }
75
- ];
76
- // react-admin-component 需要替换的文本
77
- const COMPONENTS_CONTENT_REPLACE = [
78
- {
79
- path: `\\Editor\\index.js`,
80
- replace: [
81
- [
82
- 'common/http',
83
- 'jjb-common/http'
84
- ],
85
- [
86
- 'common/crypto',
87
- 'jjb-common/crypto'
88
- ],
89
- [
90
- 'common/tools',
91
- 'jjb-common/tools'
92
- ]
93
- ]
94
- },
95
- {
96
- path: `\\RejectText\\index.js`,
97
- replace: [
98
- [
99
- 'common/color',
100
- 'jjb-common/color'
101
- ]
102
- ]
103
- },
104
- {
105
- path: `\\RouterMenu\\index.js`,
106
- replace: [
107
- [
108
- 'common/tools',
109
- 'jjb-common/tools'
110
- ]
111
- ]
112
- },
113
- {
114
- path: `\\FileUploader\\index.js`,
115
- replace: [
116
- [
117
- 'common/http',
118
- 'jjb-common/http'
119
- ],
120
- [
121
- 'common/tools',
122
- 'jjb-common/tools'
123
- ]
124
- ]
125
- },
126
- {
127
- path: `\\ImageCropper\\index.js`,
128
- replace: [
129
- [
130
- 'common/http',
131
- 'jjb-common/http'
132
- ],
133
- [
134
- 'common/tools',
135
- 'jjb-common/tools'
136
- ]
137
- ]
138
- },
139
- {
140
- path: `\\ImageUploader\\index.js`,
141
- replace: [
142
- [
143
- 'common/http',
144
- 'jjb-common/http'
145
- ],
146
- [
147
- 'common/tools',
148
- 'jjb-common/tools'
149
- ]
150
- ]
151
- },
152
- {
153
- path: `\\PageHeaderBar\\index.js`,
154
- replace: [
155
- [
156
- 'common/color',
157
- 'jjb-common/color'
158
- ]
159
- ]
160
- },
161
- {
162
- path: `\\RouterContainer\\index.js`,
163
- replace: [
164
- [
165
- 'common/tools',
166
- 'jjb-common/tools'
167
- ]
168
- ]
169
- },
170
- {
171
- path: `\\RouterContainer\\components\\NavigationTab\\index.js`,
172
- replace: [
173
- [
174
- 'common/website',
175
- 'jjb-common/website'
176
- ],
177
- [
178
- 'common/tools',
179
- 'jjb-common/tools'
180
- ]
181
- ]
182
- }
183
- ];
184
-
185
- /**
186
- * @description 生成UID
187
- * @returns {string}
188
- */
189
- function uid () {
190
- return Math.random().toString().substr(2);
191
- }
192
-
193
- module.exports = input => {
194
- /* 下发项目路径 */
195
- const root = path.resolve('./');
196
- /* 下发包名 */
197
- const packageName = `jjb-${input}`;
198
- /* 下发包版本 */
199
- const packageVerson = '1.0.0';
200
- /* 下发项目src路径 */
201
- const srcFolderPath = `${root}\\src`;
202
- /* 临时文件名称 */
203
- const templateFolderName = `template_${uid()}`;
204
- /* 临时文件路径 */
205
- const templateFolderPath = `${__dirname}\\${templateFolderName}`;
206
- /* 下发安装包package.json */
207
- const rootPackageJsonPath = `${root}\\package.json`;
208
- /* 安装包路径 */
209
- const rootNodeModulesPackagePath = `${root}\\node_modules\\jjb-${input}`;
210
- try {
211
- if (fs.existsSync(srcFolderPath)) {
212
- const cloudObj = CLOUD_PROJECT[ input ] || undefined;
213
- if (cloudObj) {
214
- const tmpDir = os.tmpdir();
215
- const zipPath = `${tmpDir}/${GIT_TEMP_DIR}/${input}.zip`;
216
- const zipFolder = `${tmpDir}/${GIT_TEMP_DIR}/unzip/`;
217
- utils.DeleteDirAllFile(`${tmpDir}/${GIT_TEMP_DIR}`, () => {
218
- fs.mkdirSync(`${tmpDir}/${GIT_TEMP_DIR}`);
219
- const stream = fs.createWriteStream(zipPath);
220
- request(`${GIT_HOST}/api/v4/projects/${cloudObj.projectId}/repository/archive.zip?private_token=${cloudObj.token}&ref=master`)
221
- .pipe(stream)
222
- .on('close', () => {
223
- fs.mkdirSync(zipFolder);
224
- compressing.zip.uncompress(zipPath, zipFolder)
225
- .then(() => {
226
- setTimeout(() => {
227
- fs.readdirSync(zipFolder).forEach(dirName => {
228
- if (dirName.indexOf('-master-') !== -1) {
229
- /* 删除下载的文件 */
230
- utils.DeleteDirAllFile(`${srcFolderPath}\\${cloudObj.localName}`, () => {
231
- /* 创建临时文件夹 */
232
- fs.mkdirSync(templateFolderPath);
233
- /* 拷贝解压后的文件到临时文件夹 */
234
- utils.CopyFolder(zipFolder + dirName, templateFolderPath);
235
- setTimeout(() => {
236
- /* 如果输入文件名是common */
237
- if (input === 'common') {
238
- /* 判断是否为多应用 */
239
- const isMutilate = fs.existsSync(`${srcFolderPath}\\application`);
240
- if (isMutilate) {
241
- /* 多应用模式下需要删除automatic文件夹 */
242
- rm_rf(`${templateFolderPath}\\dva\\automatic`);
243
- fs.rmdirSync(`${templateFolderPath}\\dva\\automatic`);
244
- } else {
245
- if (get_project_type(rootPackageJsonPath) === 'spa') {
246
- /* 替换操作 */
247
- content_replace(COMMON_CONTENT_SPA_REPLACE, templateFolderPath);
248
- fs.writeFileSync(`${templateFolderPath}\\dva\\automatic\\router.js`, fs.readFileSync(`${__dirname}\\cli.dva.router.spa.txt`).toString());
249
- fs.writeFileSync(`${templateFolderPath}\\dva\\automatic\\register.js`, fs.readFileSync(`${__dirname}\\cli.dva.register.spa.txt`).toString());
250
- } else if (get_project_type(rootPackageJsonPath) === 'micro-spa') {
251
- content_replace(COMMON_CONTENT_MICRO_REPLACE, templateFolderPath);
252
- fs.writeFileSync(`${templateFolderPath}\\dva\\automatic\\router.js`, fs.readFileSync(`${__dirname}\\cli.dva.router.saas.txt`).toString());
253
- fs.writeFileSync(`${templateFolderPath}\\dva\\automatic\\register.js`, fs.readFileSync(`${__dirname}\\cli.dva.register.saas.txt`).toString());
254
- }
255
- }
256
- /* 替换操作 */
257
- content_replace(COMMON_CONTENT_NOR_REPLACE, templateFolderPath);
258
- }
259
- /* 如果输入文件名是react-admin-component */
260
- if (input === 'react-admin-component') {
261
- /* 替换操作 */
262
- content_replace(COMPONENTS_CONTENT_REPLACE, templateFolderPath);
263
- }
264
- rm_rf(`${templateFolderPath}\\.idea`);
265
- if (fs.existsSync(`${templateFolderPath}\\.idea`)) {
266
- fs.rmdirSync(`${templateFolderPath}\\.idea`);
267
- }
268
- if (fs.existsSync(`${templateFolderPath}\\.gitignore`)) {
269
- fs.unlinkSync(`${templateFolderPath}\\.gitignore`);
270
- }
271
- /* 如果文件夹不存在 */
272
- if (!fs.existsSync(rootNodeModulesPackagePath)) {
273
- // 创建文件夹
274
- fs.mkdirSync(rootNodeModulesPackagePath);
275
- } else {
276
- // 删除旧文件
277
- rm_rf(rootNodeModulesPackagePath);
278
- }
279
- /* 复制文件到下发项目node_modules */
280
- utils.CopyFolder(templateFolderPath, rootNodeModulesPackagePath, () => {
281
- /* 删除所有临时文件 */
282
- rm_rf(templateFolderPath);
283
- /* 删除临时文件夹 */
284
- fs.rmdirSync(templateFolderPath);
285
- /* 创建下发包package.json */
286
- create_package_json(rootNodeModulesPackagePath, packageName, packageVerson);
287
- /* 下发完成更新下发项目package.json */
288
- update_project_package_json(rootPackageJsonPath, packageName, packageVerson);
289
- /* 完成操作 */
290
- console.log(`【已安装】:${packageName} v${packageVerson}`);
291
- });
292
- }, 1000);
293
- });
294
- }
295
- });
296
- }, 2000);
297
- });
298
- });
299
- });
300
- } else {
301
- console.error(`【Error】: 未获取到项目 ${input}`);
302
- }
303
- }
304
- } catch (e) {
305
- console.error('【Error】: 当前目录不存在src子目录,无法完成pull操作。');
306
- }
307
- };
308
-
309
- /**
310
- * @description 删除全部
311
- * @param path
312
- */
313
- function rm_rf (path) {
314
- if (fs.existsSync(path)) {
315
- const list = fs.readdirSync(path);
316
- for (let i = 0; i < list.length; i++) {
317
- const item = list[ i ];
318
- const vPath = `${path}/${item}`;
319
- if (fs.statSync(vPath).isDirectory()) {
320
- rm_rf(vPath);
321
- fs.rmdirSync(vPath);
322
- } else {
323
- fs.unlinkSync(vPath);
324
- }
325
- }
326
- }
327
- }
328
-
329
- /**
330
- * @description 创建package.json
331
- * @param path {string} 路径
332
- * @param name {string} 包名
333
- * @param version {string} 版本
334
- */
335
- function create_package_json (path, name, version) {
336
- fs.writeFileSync(`${path}\\package.json`, `{"name":"${name}","version":"${version}","main": "index.js"}`);
337
- }
338
-
339
- /**
340
- * @description 获取项目类型
341
- * @param path {string} 路径
342
- * @returns {string}
343
- */
344
- function get_project_type (path) {
345
- const packageJSONFile = JSON.parse(fs.readFileSync(path).toString());
346
- return packageJSONFile.projectType;
347
- }
348
-
349
- /**
350
- * @description 更新项目package.json文件
351
- * @param path {string} 路径
352
- * @param name {string} 包名
353
- * @param version {string} 版本
354
- */
355
- function update_project_package_json (path, name, version) {
356
- const packageJSONFile = JSON.parse(fs.readFileSync(path).toString());
357
- packageJSONFile.dependencies[ name ] = version;
358
- fs.writeFileSync(path, JSON.stringify(packageJSONFile, null, 2));
359
- }
360
-
361
- /**
362
- * @description 替换文件操作
363
- * @param source {[]} 替换源
364
- * @param root {string} 路径
365
- */
366
- function content_replace (source = [], root) {
367
- source.forEach(item => {
368
- const path = root + item.path;
369
- if (fs.existsSync(path)) {
370
- let content = fs.readFileSync(path).toString();
371
- item.replace.forEach(rep => {
372
- content = content.replace(rep[ 0 ], rep[ 1 ]);
373
- });
374
- fs.writeFileSync(path, content);
375
- }
376
- });
377
- }
1
+ 'use strict';function a21_0xd083(_0x56eea7,_0x544826){const _0x3db2c0=a21_0x3db2();return a21_0xd083=function(_0xd0837,_0x44b5df){_0xd0837=_0xd0837-0xda;let _0x577098=_0x3db2c0[_0xd0837];return _0x577098;},a21_0xd083(_0x56eea7,_0x544826);}const a21_0x3829b3=a21_0xd083;(function(_0x43b4e0,_0xff99a4){const _0x126b15=a21_0xd083,_0x5658fa=_0x43b4e0();while(!![]){try{const _0x166fb0=parseInt(_0x126b15(0xe2))/0x1+-parseInt(_0x126b15(0x114))/0x2*(parseInt(_0x126b15(0x10d))/0x3)+parseInt(_0x126b15(0xf2))/0x4+parseInt(_0x126b15(0xdf))/0x5*(parseInt(_0x126b15(0xf1))/0x6)+parseInt(_0x126b15(0x101))/0x7*(-parseInt(_0x126b15(0x116))/0x8)+-parseInt(_0x126b15(0x110))/0x9+parseInt(_0x126b15(0xfd))/0xa;if(_0x166fb0===_0xff99a4)break;else _0x5658fa['push'](_0x5658fa['shift']());}catch(_0x4d19db){_0x5658fa['push'](_0x5658fa['shift']());}}}(a21_0x3db2,0x203ea));const fs=require('fs'),os=require('os'),path=require(a21_0x3829b3(0x12e)),utils=require(a21_0x3829b3(0x111)),request=require(a21_0x3829b3(0x134)),compressing=require(a21_0x3829b3(0xe7)),GIT_HOST=a21_0x3829b3(0x103),GIT_TEMP_DIR=a21_0x3829b3(0x11e),CLOUD_PROJECT={'common':{'token':a21_0x3829b3(0x115),'projectId':0x117,'localName':'common'},'react-admin-component':{'token':'FT3pKzxpRynFkmddJ9Bs','projectId':0x154,'localName':a21_0x3829b3(0xea)}},COMMON_CONTENT_NOR_REPLACE=[{'path':'\x5ctools\x5cindex.js','replace':[[a21_0x3829b3(0xea),a21_0x3829b3(0x109)]]},{'path':a21_0x3829b3(0xe3),'replace':[[/const\srelation\s=\srequire\(`~\/application\/\${module.code}\/enumerate\/menu`\)\.default;/,a21_0x3829b3(0xe6)],['components',a21_0x3829b3(0x109)]]}],COMMON_CONTENT_SPA_REPLACE=[{'path':a21_0x3829b3(0xfe),'replace':[[a21_0x3829b3(0xf9),'return\x20process.env;']]}],COMMON_CONTENT_MICRO_REPLACE=[{'path':'\x5ctools\x5cindex.js','replace':[[a21_0x3829b3(0xf9),a21_0x3829b3(0x123)]]}],COMPONENTS_CONTENT_REPLACE=[{'path':a21_0x3829b3(0xec),'replace':[[a21_0x3829b3(0x108),a21_0x3829b3(0xde)],[a21_0x3829b3(0x113),a21_0x3829b3(0xf3)],[a21_0x3829b3(0xda),'jjb-common/tools']]},{'path':a21_0x3829b3(0xef),'replace':[[a21_0x3829b3(0xed),'jjb-common/color']]},{'path':a21_0x3829b3(0xfb),'replace':[[a21_0x3829b3(0xda),a21_0x3829b3(0x132)]]},{'path':'\x5cFileUploader\x5cindex.js','replace':[[a21_0x3829b3(0x108),a21_0x3829b3(0xde)],[a21_0x3829b3(0xda),a21_0x3829b3(0x132)]]},{'path':a21_0x3829b3(0x10c),'replace':[['common/http','jjb-common/http'],[a21_0x3829b3(0xda),'jjb-common/tools']]},{'path':a21_0x3829b3(0x127),'replace':[['common/http',a21_0x3829b3(0xde)],[a21_0x3829b3(0xda),a21_0x3829b3(0x132)]]},{'path':a21_0x3829b3(0x102),'replace':[['common/color',a21_0x3829b3(0x10a)]]},{'path':'\x5cRouterContainer\x5cindex.js','replace':[[a21_0x3829b3(0xda),a21_0x3829b3(0x132)]]},{'path':'\x5cRouterContainer\x5ccomponents\x5cNavigationTab\x5cindex.js','replace':[[a21_0x3829b3(0xdd),'jjb-common/website'],[a21_0x3829b3(0xda),a21_0x3829b3(0x132)]]}];function a21_0x3db2(){const _0x1bf98b=['close','jjb-common/tools','parse','request','dependencies','error','common/tools','\x5c.gitignore','template_','common/website','jjb-common/http','144825IEnaFQ','\x22,\x22version\x22:\x22','{\x22name\x22:\x22','30185uatRjC','\x5cwebsite\x5cindex.js','isDirectory','.zip','const\x20relation\x20=\x20require(\x27~/enumerate/menu\x27).default;','compressing','createWriteStream','forEach','components','pipe','\x5cEditor\x5cindex.js','common/color','tmpdir','\x5cRejectText\x5cindex.js','\x5c.idea','30SvkQZz','299376eoCgmC','jjb-common/crypto','unlinkSync','\x5csrc','rmdirSync','jjb-','1.0.0','return\x20__planA();','indexOf','\x5cRouterMenu\x5cindex.js','readFileSync','1771060VSXpyL','\x5ctools\x5cindex.js','length','&ref=master','1398887EvpXGh','\x5cPageHeaderBar\x5cindex.js','http://192.168.1.242:10985','replace','token','common','resolve','common/http','jjb-react-admin-component','jjb-common/color','\x5ccli.dva.register.spa.txt','\x5cImageCropper\x5cindex.js','79062XwLTrv','react-admin-component','\x5cdva\x5cautomatic','618219uqKoOC','./util','writeFileSync','common/crypto','2kvpjmR','G4HJRsHr9D7Ssmixegw2','8IoUWoE','\x5cdva\x5cautomatic\x5crouter.js','/repository/archive.zip?private_token=','DeleteDirAllFile','uncompress','【Error】:\x20当前目录不存在src子目录,无法完成pull操作。','mkdirSync','\x5cpackage.json','jjbAssembly','statSync','readdirSync','log','projectType','return\x20process.env.app;','\x5ccli.dva.router.saas.txt','toString','\x5capplication','\x5cImageUploader\x5cindex.js','spa','existsSync','\x5cnode_modules\x5cjjb-','CopyFolder','stringify','【已安装】:','path','then','zip'];a21_0x3db2=function(){return _0x1bf98b;};return a21_0x3db2();}function uid(){const _0x444477=a21_0x3829b3;return Math['random']()[_0x444477(0x125)]()['substr'](0x2);}module['exports']=_0x5e7329=>{const _0x41bab0=a21_0x3829b3,_0x6d663d=path[_0x41bab0(0x107)]('./'),_0x541db0=_0x41bab0(0xf7)+_0x5e7329,_0x2a3bac=_0x41bab0(0xf8),_0x5bfb7c=_0x6d663d+_0x41bab0(0xf5),_0x1928e6=_0x41bab0(0xdc)+uid(),_0x426e52=__dirname+'\x5c'+_0x1928e6,_0x11b237=_0x6d663d+_0x41bab0(0x11d),_0x5411da=_0x6d663d+_0x41bab0(0x12a)+_0x5e7329;try{if(fs['existsSync'](_0x5bfb7c)){const _0x468d46=CLOUD_PROJECT[_0x5e7329]||undefined;if(_0x468d46){const _0x43be0b=os[_0x41bab0(0xee)](),_0x15b87d=_0x43be0b+'/'+GIT_TEMP_DIR+'/'+_0x5e7329+_0x41bab0(0xe5),_0x2c3bc6=_0x43be0b+'/'+GIT_TEMP_DIR+'/unzip/';utils[_0x41bab0(0x119)](_0x43be0b+'/'+GIT_TEMP_DIR,()=>{const _0x1131a9=_0x41bab0;fs[_0x1131a9(0x11c)](_0x43be0b+'/'+GIT_TEMP_DIR);const _0x4c7c65=fs[_0x1131a9(0xe8)](_0x15b87d);request(GIT_HOST+'/api/v4/projects/'+_0x468d46['projectId']+_0x1131a9(0x118)+_0x468d46[_0x1131a9(0x105)]+_0x1131a9(0x100))[_0x1131a9(0xeb)](_0x4c7c65)['on'](_0x1131a9(0x131),()=>{const _0x4de3a2=_0x1131a9;fs[_0x4de3a2(0x11c)](_0x2c3bc6),compressing[_0x4de3a2(0x130)][_0x4de3a2(0x11a)](_0x15b87d,_0x2c3bc6)[_0x4de3a2(0x12f)](()=>{setTimeout(()=>{const _0x1818d4=a21_0xd083;fs[_0x1818d4(0x120)](_0x2c3bc6)['forEach'](_0x4d9412=>{const _0x42c04e=_0x1818d4;_0x4d9412[_0x42c04e(0xfa)]('-master-')!==-0x1&&utils[_0x42c04e(0x119)](_0x5bfb7c+'\x5c'+_0x468d46['localName'],()=>{const _0xd7c33d=_0x42c04e;fs[_0xd7c33d(0x11c)](_0x426e52),utils['CopyFolder'](_0x2c3bc6+_0x4d9412,_0x426e52),setTimeout(()=>{const _0xffd5d2=_0xd7c33d;if(_0x5e7329===_0xffd5d2(0x106)){const _0x3f4a6d=fs[_0xffd5d2(0x129)](_0x5bfb7c+_0xffd5d2(0x126));if(_0x3f4a6d)rm_rf(_0x426e52+_0xffd5d2(0x10f)),fs[_0xffd5d2(0xf6)](_0x426e52+_0xffd5d2(0x10f));else{if(get_project_type(_0x11b237)===_0xffd5d2(0x128))content_replace(COMMON_CONTENT_SPA_REPLACE,_0x426e52),fs[_0xffd5d2(0x112)](_0x426e52+_0xffd5d2(0x117),fs['readFileSync'](__dirname+'\x5ccli.dva.router.spa.txt')['toString']()),fs[_0xffd5d2(0x112)](_0x426e52+'\x5cdva\x5cautomatic\x5cregister.js',fs[_0xffd5d2(0xfc)](__dirname+_0xffd5d2(0x10b))[_0xffd5d2(0x125)]());else get_project_type(_0x11b237)==='micro-spa'&&(content_replace(COMMON_CONTENT_MICRO_REPLACE,_0x426e52),fs[_0xffd5d2(0x112)](_0x426e52+_0xffd5d2(0x117),fs[_0xffd5d2(0xfc)](__dirname+_0xffd5d2(0x124))[_0xffd5d2(0x125)]()),fs[_0xffd5d2(0x112)](_0x426e52+'\x5cdva\x5cautomatic\x5cregister.js',fs[_0xffd5d2(0xfc)](__dirname+'\x5ccli.dva.register.saas.txt')[_0xffd5d2(0x125)]()));}content_replace(COMMON_CONTENT_NOR_REPLACE,_0x426e52);}_0x5e7329===_0xffd5d2(0x10e)&&content_replace(COMPONENTS_CONTENT_REPLACE,_0x426e52),rm_rf(_0x426e52+_0xffd5d2(0xf0)),fs[_0xffd5d2(0x129)](_0x426e52+_0xffd5d2(0xf0))&&fs[_0xffd5d2(0xf6)](_0x426e52+_0xffd5d2(0xf0)),fs['existsSync'](_0x426e52+'\x5c.gitignore')&&fs[_0xffd5d2(0xf4)](_0x426e52+_0xffd5d2(0xdb)),!fs[_0xffd5d2(0x129)](_0x5411da)?fs[_0xffd5d2(0x11c)](_0x5411da):rm_rf(_0x5411da),utils[_0xffd5d2(0x12b)](_0x426e52,_0x5411da,()=>{const _0x4cdc00=_0xffd5d2;rm_rf(_0x426e52),fs[_0x4cdc00(0xf6)](_0x426e52),create_package_json(_0x5411da,_0x541db0,_0x2a3bac),update_project_package_json(_0x11b237,_0x541db0,_0x2a3bac),console[_0x4cdc00(0x121)](_0x4cdc00(0x12d)+_0x541db0+'\x20v'+_0x2a3bac);});},0x3e8);});});},0x7d0);});});});}else console[_0x41bab0(0x136)]('【Error】:\x20未获取到项目\x20'+_0x5e7329);}}catch(_0x433a95){console[_0x41bab0(0x136)](_0x41bab0(0x11b));}};function rm_rf(_0x194dbc){const _0xabee80=a21_0x3829b3;if(fs['existsSync'](_0x194dbc)){const _0x197bf1=fs[_0xabee80(0x120)](_0x194dbc);for(let _0x115fd9=0x0;_0x115fd9<_0x197bf1[_0xabee80(0xff)];_0x115fd9++){const _0x2ad7c6=_0x197bf1[_0x115fd9],_0x44b4a0=_0x194dbc+'/'+_0x2ad7c6;fs[_0xabee80(0x11f)](_0x44b4a0)[_0xabee80(0xe4)]()?(rm_rf(_0x44b4a0),fs['rmdirSync'](_0x44b4a0)):fs[_0xabee80(0xf4)](_0x44b4a0);}}}function create_package_json(_0x14873c,_0x1a8f60,_0x18bc84){const _0x1c8c81=a21_0x3829b3;fs[_0x1c8c81(0x112)](_0x14873c+_0x1c8c81(0x11d),_0x1c8c81(0xe1)+_0x1a8f60+_0x1c8c81(0xe0)+_0x18bc84+'\x22,\x22main\x22:\x20\x22index.js\x22}');}function get_project_type(_0x52ee34){const _0x1796c2=a21_0x3829b3,_0x29942a=JSON[_0x1796c2(0x133)](fs[_0x1796c2(0xfc)](_0x52ee34)['toString']());return _0x29942a[_0x1796c2(0x122)];}function update_project_package_json(_0x21ad2c,_0x2e29d2,_0x21776b){const _0x11d8a9=a21_0x3829b3,_0x5350b4=JSON[_0x11d8a9(0x133)](fs['readFileSync'](_0x21ad2c)[_0x11d8a9(0x125)]());_0x5350b4[_0x11d8a9(0x135)][_0x2e29d2]=_0x21776b,fs[_0x11d8a9(0x112)](_0x21ad2c,JSON[_0x11d8a9(0x12c)](_0x5350b4,null,0x2));}function content_replace(_0x1ba59e=[],_0x104c42){const _0x2255f6=a21_0x3829b3;_0x1ba59e[_0x2255f6(0xe9)](_0x43ac3a=>{const _0x5cb5e5=_0x2255f6,_0x3c0068=_0x104c42+_0x43ac3a[_0x5cb5e5(0x12e)];if(fs['existsSync'](_0x3c0068)){let _0x23a095=fs[_0x5cb5e5(0xfc)](_0x3c0068)[_0x5cb5e5(0x125)]();_0x43ac3a[_0x5cb5e5(0x104)][_0x5cb5e5(0xe9)](_0x17d362=>{const _0x3d5a49=_0x5cb5e5;_0x23a095=_0x23a095[_0x3d5a49(0x104)](_0x17d362[0x0],_0x17d362[0x1]);}),fs[_0x5cb5e5(0x112)](_0x3c0068,_0x23a095);}});}
@@ -1,88 +1 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const readline = require('readline');
4
- const ProgressBar = require('./progress-bar');
5
- const io = readline.createInterface({
6
- input: process.stdin,
7
- output: process.stdout
8
- });
9
- const progress = new ProgressBar('删除进度', 50);
10
-
11
- let f_total = 0;
12
- let f_number = 0;
13
-
14
- module.exports = function () {
15
- const root_path = path.resolve('./');
16
-
17
- io.question('是否确认删除?删除后不可恢复![y/n]:', function (answer) {
18
- if (answer.trim() === 'y') {
19
- console.log('正在计算项目数,请稍等...');
20
- setTimeout(() => {
21
- // scanner(root_path);
22
- // console.log(`计算完成共计[${f_total}]项目。`);
23
- setTimeout(() => {
24
- console.clear();
25
- exec(root_path);
26
- setTimeout(() => {
27
- console.log('删除完成。');
28
- console.clear();
29
- process.exit(0);
30
- }, 500);
31
- }, 500);
32
- }, 500);
33
- } else if (answer.trim() === 'n') {
34
- console.log('取消删除。');
35
- process.exit(0);
36
- } else {
37
- console.log('无效操作。');
38
- process.exit(0);
39
- }
40
- });
41
- };
42
-
43
- function exec (path) {
44
- if (fs.existsSync(path)) {
45
- const list = fs.readdirSync(path);
46
- for (let i = 0; i < list.length; i++) {
47
- const item = list[ i ];
48
- const vPath = `${path}/${item}`;
49
- try {
50
- if (fs.statSync(vPath).isDirectory()) {
51
- exec(vPath);
52
- fs.rmdirSync(vPath, { recursive: true });
53
- // f_number = f_number + 1;
54
- console.log('删除文件夹:' + vPath);
55
- } else {
56
- fs.unlinkSync(vPath);
57
- // f_number = f_number + 1;
58
- console.log('删除文件:' + vPath);
59
- }
60
- // progress.render({
61
- // completed: f_number,
62
- // total: f_total
63
- // });
64
- } catch (e) {
65
- console.log('删除异常:' + vPath);
66
- }
67
- }
68
- }
69
- }
70
-
71
- function scanner (path) {
72
- if (fs.existsSync(path)) {
73
- const list = fs.readdirSync(path);
74
- for (let i = 0; i < list.length; i++) {
75
- const item = list[ i ];
76
- const vPath = `${path}/${item}`;
77
- try {
78
- if (fs.statSync(vPath).isDirectory()) {
79
- scanner(vPath);
80
- f_total = f_total + 1;
81
- } else {
82
- f_total = f_total + 1;
83
- }
84
- } catch (e) {
85
- }
86
- }
87
- }
88
- }
1
+ const a22_0x277b80=a22_0x4d04;(function(_0x1c8ef3,_0x288c6e){const _0x3c07a3=a22_0x4d04,_0x25483a=_0x1c8ef3();while(!![]){try{const _0x4054fc=-parseInt(_0x3c07a3(0x1ae))/0x1+parseInt(_0x3c07a3(0x1a5))/0x2+parseInt(_0x3c07a3(0x19a))/0x3+parseInt(_0x3c07a3(0x1b2))/0x4+parseInt(_0x3c07a3(0x1a3))/0x5+parseInt(_0x3c07a3(0x1a7))/0x6+parseInt(_0x3c07a3(0x1b8))/0x7*(-parseInt(_0x3c07a3(0x1a9))/0x8);if(_0x4054fc===_0x288c6e)break;else _0x25483a['push'](_0x25483a['shift']());}catch(_0x45a5d0){_0x25483a['push'](_0x25483a['shift']());}}}(a22_0xb6e0,0x6e120));const fs=require('fs'),path=require('path'),readline=require(a22_0x277b80(0x1b3)),ProgressBar=require(a22_0x277b80(0x199)),io=readline[a22_0x277b80(0x19f)]({'input':process[a22_0x277b80(0x1b5)],'output':process[a22_0x277b80(0x1a6)]}),progress=new ProgressBar(a22_0x277b80(0x1a4),0x32);function a22_0x4d04(_0x1b3b47,_0x4303a9){const _0xb6e032=a22_0xb6e0();return a22_0x4d04=function(_0x4d04ee,_0x200b86){_0x4d04ee=_0x4d04ee-0x198;let _0x2ecd10=_0xb6e032[_0x4d04ee];return _0x2ecd10;},a22_0x4d04(_0x1b3b47,_0x4303a9);}let f_total=0x0,f_number=0x0;module['exports']=function(){const _0x8f26fa=a22_0x277b80,_0x569b08=path[_0x8f26fa(0x1b7)]('./');io[_0x8f26fa(0x1af)]('是否确认删除?删除后不可恢复![y/n]:',function(_0x4a297a){const _0x190631=_0x8f26fa;if(_0x4a297a[_0x190631(0x19b)]()==='y')console['log'](_0x190631(0x1a8)),setTimeout(()=>{setTimeout(()=>{const _0x301251=a22_0x4d04;console[_0x301251(0x1b4)](),exec(_0x569b08),setTimeout(()=>{const _0x20ecbc=_0x301251;console[_0x20ecbc(0x1a0)]('删除完成。'),console['clear'](),process['exit'](0x0);},0x1f4);},0x1f4);},0x1f4);else _0x4a297a[_0x190631(0x19b)]()==='n'?(console[_0x190631(0x1a0)](_0x190631(0x1b6)),process[_0x190631(0x1b0)](0x0)):(console[_0x190631(0x1a0)](_0x190631(0x1ab)),process[_0x190631(0x1b0)](0x0));});};function exec(_0x5e7a16){const _0x1f8ecc=a22_0x277b80;if(fs[_0x1f8ecc(0x1a1)](_0x5e7a16)){const _0x16b561=fs[_0x1f8ecc(0x1ad)](_0x5e7a16);for(let _0x4b8b3f=0x0;_0x4b8b3f<_0x16b561[_0x1f8ecc(0x198)];_0x4b8b3f++){const _0x23ced5=_0x16b561[_0x4b8b3f],_0xa3a3b=_0x5e7a16+'/'+_0x23ced5;try{fs[_0x1f8ecc(0x19e)](_0xa3a3b)[_0x1f8ecc(0x1ac)]()?(exec(_0xa3a3b),fs[_0x1f8ecc(0x1a2)](_0xa3a3b,{'recursive':!![]}),console[_0x1f8ecc(0x1a0)](_0x1f8ecc(0x19d)+_0xa3a3b)):(fs[_0x1f8ecc(0x1b1)](_0xa3a3b),console['log'](_0x1f8ecc(0x19c)+_0xa3a3b));}catch(_0x263ebb){console[_0x1f8ecc(0x1a0)](_0x1f8ecc(0x1aa)+_0xa3a3b);}}}}function scanner(_0x354b6f){const _0x1b3e33=a22_0x277b80;if(fs[_0x1b3e33(0x1a1)](_0x354b6f)){const _0x392813=fs[_0x1b3e33(0x1ad)](_0x354b6f);for(let _0x53cb92=0x0;_0x53cb92<_0x392813[_0x1b3e33(0x198)];_0x53cb92++){const _0x3213a5=_0x392813[_0x53cb92],_0x19117a=_0x354b6f+'/'+_0x3213a5;try{fs[_0x1b3e33(0x19e)](_0x19117a)['isDirectory']()?(scanner(_0x19117a),f_total=f_total+0x1):f_total=f_total+0x1;}catch(_0x4701e0){}}}}function a22_0xb6e0(){const _0x439f32=['4653300dfhVfS','正在计算项目数,请稍等...','48WTojnR','删除异常:','无效操作。','isDirectory','readdirSync','334714HRFRWZ','question','exit','unlinkSync','1513584HcoUIk','readline','clear','stdin','取消删除。','resolve','1845529lRKKTM','length','./progress-bar','2308818teIiPx','trim','删除文件:','删除文件夹:','statSync','createInterface','log','existsSync','rmdirSync','1801625XTefdy','删除进度','167134NXciFF','stdout'];a22_0xb6e0=function(){return _0x439f32;};return a22_0xb6e0();}
@@ -1,23 +1 @@
1
- const slog = require('single-line-log').stdout;
2
-
3
- function ProgressBar (description, bar_length) {
4
- this.description = description || 'Progress';
5
- this.length = bar_length || 25;
6
- this.render = function (opts) {
7
- let i;
8
- const percent = (opts.completed / opts.total).toFixed(4);
9
- const cell_num = Math.floor(percent * this.length);
10
- let cell = '';
11
- for (i = 0; i < cell_num; i++) {
12
- cell += '█';
13
- }
14
- let empty = '';
15
- for (i = 0; i < this.length - cell_num; i++) {
16
- empty += '░';
17
- }
18
- const cmdText = this.description + ': ' + (100 * percent).toFixed(2) + '% ' + cell + empty + ' ' + opts.completed + '/' + opts.total;
19
- slog(cmdText);
20
- };
21
- }
22
-
23
- module.exports = ProgressBar;
1
+ function a23_0x4d25(){const _0xc2e503=['render','5580200RfnbPi','Progress','completed','floor','exports','3122wnuqxL','21236832LLBjlE','1099408pLCGGk','single-line-log','8929044pTUMvu','length','710017cgpcwv','309YzOvdX','total','3906700QCUJyx','stdout','description','toFixed'];a23_0x4d25=function(){return _0xc2e503;};return a23_0x4d25();}const a23_0x2a1f16=a23_0xf031;(function(_0x16ad89,_0x1f59c8){const _0x351037=a23_0xf031,_0x3f0f38=_0x16ad89();while(!![]){try{const _0x180cfa=-parseInt(_0x351037(0x143))/0x1+-parseInt(_0x351037(0x141))/0x2*(parseInt(_0x351037(0x148))/0x3)+-parseInt(_0x351037(0x14f))/0x4+-parseInt(_0x351037(0x14a))/0x5+parseInt(_0x351037(0x145))/0x6+parseInt(_0x351037(0x147))/0x7+parseInt(_0x351037(0x142))/0x8;if(_0x180cfa===_0x1f59c8)break;else _0x3f0f38['push'](_0x3f0f38['shift']());}catch(_0x52a1ab){_0x3f0f38['push'](_0x3f0f38['shift']());}}}(a23_0x4d25,0xc52cc));function a23_0xf031(_0x6cedfa,_0x215e47){const _0x4d250b=a23_0x4d25();return a23_0xf031=function(_0xf03112,_0x1c43eb){_0xf03112=_0xf03112-0x140;let _0x1e6162=_0x4d250b[_0xf03112];return _0x1e6162;},a23_0xf031(_0x6cedfa,_0x215e47);}const slog=require(a23_0x2a1f16(0x144))[a23_0x2a1f16(0x14b)];function ProgressBar(_0x4fb03a,_0x2db30b){const _0x1e1fcb=a23_0x2a1f16;this['description']=_0x4fb03a||_0x1e1fcb(0x150),this['length']=_0x2db30b||0x19,this[_0x1e1fcb(0x14e)]=function(_0x4a845a){const _0x58629f=_0x1e1fcb;let _0x47aa8e;const _0x34eeb9=(_0x4a845a[_0x58629f(0x151)]/_0x4a845a[_0x58629f(0x149)])[_0x58629f(0x14d)](0x4),_0x340cfe=Math[_0x58629f(0x152)](_0x34eeb9*this[_0x58629f(0x146)]);let _0x43fbf2='';for(_0x47aa8e=0x0;_0x47aa8e<_0x340cfe;_0x47aa8e++){_0x43fbf2+='█';}let _0x43ec67='';for(_0x47aa8e=0x0;_0x47aa8e<this['length']-_0x340cfe;_0x47aa8e++){_0x43ec67+='░';}const _0x12ac40=this[_0x58629f(0x14c)]+':\x20'+(0x64*_0x34eeb9)[_0x58629f(0x14d)](0x2)+'%\x20'+_0x43fbf2+_0x43ec67+'\x20'+_0x4a845a[_0x58629f(0x151)]+'/'+_0x4a845a[_0x58629f(0x149)];slog(_0x12ac40);};}module[a23_0x2a1f16(0x140)]=ProgressBar;
package/src/old/util.js CHANGED
@@ -1,149 +1 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- /**
7
- * @description 清空当前目录
8
- * @param filePath
9
- * @param callback
10
- * @constructor
11
- */
12
- exports.DeleteDirAllFile = (filePath, callback) => {
13
- let files = [];
14
- const that = this;
15
- if(fs.existsSync(filePath)) {
16
- files = fs.readdirSync(filePath);
17
- files.forEach(function(file, index) {
18
- let curPath = filePath + "/" + file;
19
- if(fs.statSync(curPath).isDirectory()) {
20
- that.DeleteDirAllFile(curPath);
21
- } else {
22
- fs.unlinkSync(curPath);
23
- }
24
- });
25
- fs.rmdirSync(filePath);
26
- callback && callback();
27
- } else {
28
- callback && callback();
29
- }
30
- };
31
-
32
- /**
33
- * @description 复制文件夹及子目录文件
34
- * @param srcDir
35
- * @param tarDir
36
- * @param cb
37
- */
38
- exports.CopyFolder = (srcDir, tarDir, cb) => {
39
- const that = this;
40
- fs.readdir(srcDir, function(err, files) {
41
-
42
- let count = 0
43
- const checkEnd = function() {
44
- ++count === files.length && cb && cb()
45
- }
46
-
47
- if (err) {
48
- checkEnd()
49
- return
50
- }
51
-
52
- files.forEach(function(file) {
53
- const srcPath = path.join(srcDir, file)
54
- const tarPath = path.join(tarDir, file)
55
-
56
- fs.stat(srcPath, function(err, stats) {
57
- if (stats.isDirectory()) {
58
- fs.mkdir(tarPath, function(err) {
59
- if (err) {
60
- console.log(err)
61
- return
62
- }
63
-
64
- that.CopyFolder(srcPath, tarPath, checkEnd)
65
- })
66
- } else {
67
- that.CopyFile(srcPath, tarPath, checkEnd)
68
- }
69
- })
70
- })
71
- //为空时直接回调
72
- files.length === 0 && cb && cb()
73
- })
74
- }
75
-
76
- /**
77
- * @description 复制文件
78
- * @param srcPath
79
- * @param tarPath
80
- * @param cb
81
- */
82
- exports.CopyFile = (srcPath, tarPath, cb) => {
83
- const rs = fs.createReadStream(srcPath)
84
- rs.on('error', function(err) {
85
- if (err) {
86
- console.log('read error', srcPath)
87
- }
88
- cb && cb(err)
89
- })
90
-
91
- const ws = fs.createWriteStream(tarPath)
92
- ws.on('error', function(err) {
93
- if (err) {
94
- console.log('write error', tarPath)
95
- }
96
- cb && cb(err)
97
- })
98
- ws.on('close', function(ex) {
99
- cb && cb(ex)
100
- })
101
-
102
- rs.pipe(ws)
103
- };
104
-
105
- /**
106
- * 深度获取目录路径
107
- * @param path
108
- * @param pathChildren
109
- * @constructor
110
- */
111
- exports.DeepScanner = (path, pathChildren) => {
112
- const that = this;
113
- const itemList = fs.readdirSync(path);
114
- itemList.forEach(item => {
115
- const childPath = `${path}/${item}`;
116
- const stat = fs.statSync(childPath);
117
- if (stat.isDirectory()) {
118
- that.DeepScanner(childPath, pathChildren);
119
- } else {
120
- pathChildren.push(childPath);
121
- }
122
- });
123
- };
124
-
125
- /**
126
- * 创建目录路径
127
- * @param pathArr
128
- */
129
- exports.CreatePaths = (rootPath, pathArr) => {
130
- return new Promise(resolve => {
131
- const linkStr = [];
132
- pathArr.forEach((item, index) => {
133
- const dirPath = rootPath + '/' + linkStr.join('/') + '/' + item;
134
- try {
135
- const stat = fs.statSync(dirPath);
136
- if (stat.isDirectory()) {
137
- index === pathArr.length - 1 && resolve();
138
- } else {
139
- fs.mkdirSync(dirPath);
140
- index === pathArr.length - 1 && resolve();
141
- }
142
- } catch (e) {
143
- fs.mkdirSync(dirPath);
144
- index === pathArr.length - 1 && resolve();
145
- }
146
- linkStr.push(item);
147
- });
148
- });
149
- };
1
+ 'use strict';const a24_0x3aac4d=a24_0x21cf;function a24_0x21cf(_0x21ac80,_0x5e81c1){const _0x29ee77=a24_0x29ee();return a24_0x21cf=function(_0x21cff5,_0x2382fb){_0x21cff5=_0x21cff5-0x73;let _0x5f120f=_0x29ee77[_0x21cff5];return _0x5f120f;},a24_0x21cf(_0x21ac80,_0x5e81c1);}(function(_0x556d24,_0x44aa38){const _0x3a0fe5=a24_0x21cf,_0x469cb3=_0x556d24();while(!![]){try{const _0x589ec0=parseInt(_0x3a0fe5(0x94))/0x1+-parseInt(_0x3a0fe5(0x84))/0x2*(-parseInt(_0x3a0fe5(0x90))/0x3)+parseInt(_0x3a0fe5(0x7d))/0x4*(-parseInt(_0x3a0fe5(0x92))/0x5)+-parseInt(_0x3a0fe5(0x80))/0x6*(parseInt(_0x3a0fe5(0x75))/0x7)+-parseInt(_0x3a0fe5(0x81))/0x8+parseInt(_0x3a0fe5(0x8c))/0x9*(parseInt(_0x3a0fe5(0x82))/0xa)+-parseInt(_0x3a0fe5(0x86))/0xb;if(_0x589ec0===_0x44aa38)break;else _0x469cb3['push'](_0x469cb3['shift']());}catch(_0x30f0a6){_0x469cb3['push'](_0x469cb3['shift']());}}}(a24_0x29ee,0x600a6));function a24_0x29ee(){const _0x97deb8=['readdir','join','length','statSync','227764JGkBtg','DeepScanner','rmdirSync','486kxkmCD','2896352KCqisA','30iNAcxY','isDirectory','46966FhrsQJ','CopyFolder','761420YNWmsK','DeleteDirAllFile','mkdirSync','createReadStream','CreatePaths','read\x20error','2067651qxMvPg','forEach','log','path','90eIafCQ','readdirSync','35GbLIHK','push','76495YPwovw','mkdir','CopyFile','21343oBjoZq','close','existsSync','pipe'];a24_0x29ee=function(){return _0x97deb8;};return a24_0x29ee();}const fs=require('fs'),path=require(a24_0x3aac4d(0x8f));exports[a24_0x3aac4d(0x87)]=(_0x1d1688,_0x531eb8)=>{const _0x31c69d=a24_0x3aac4d;let _0x3f4b48=[];const _0x3e0f4f=this;fs[_0x31c69d(0x77)](_0x1d1688)?(_0x3f4b48=fs[_0x31c69d(0x91)](_0x1d1688),_0x3f4b48[_0x31c69d(0x8d)](function(_0x213d89,_0x311b81){const _0x1efb6c=_0x31c69d;let _0x47e268=_0x1d1688+'/'+_0x213d89;fs[_0x1efb6c(0x7c)](_0x47e268)[_0x1efb6c(0x83)]()?_0x3e0f4f[_0x1efb6c(0x87)](_0x47e268):fs['unlinkSync'](_0x47e268);}),fs[_0x31c69d(0x7f)](_0x1d1688),_0x531eb8&&_0x531eb8()):_0x531eb8&&_0x531eb8();},exports[a24_0x3aac4d(0x85)]=(_0x5c34b2,_0x367fdc,_0x1a747d)=>{const _0xf7f5b2=a24_0x3aac4d,_0x274737=this;fs[_0xf7f5b2(0x79)](_0x5c34b2,function(_0x18a915,_0x162682){const _0x124fb7=_0xf7f5b2;let _0x1d8010=0x0;const _0x36a4fd=function(){const _0x3c14e7=a24_0x21cf;++_0x1d8010===_0x162682[_0x3c14e7(0x7b)]&&_0x1a747d&&_0x1a747d();};if(_0x18a915){_0x36a4fd();return;}_0x162682['forEach'](function(_0x436540){const _0xef838f=a24_0x21cf,_0x23972e=path[_0xef838f(0x7a)](_0x5c34b2,_0x436540),_0x45a364=path[_0xef838f(0x7a)](_0x367fdc,_0x436540);fs['stat'](_0x23972e,function(_0x411c22,_0x33641f){const _0x13d2ef=_0xef838f;_0x33641f[_0x13d2ef(0x83)]()?fs[_0x13d2ef(0x73)](_0x45a364,function(_0x1dcd00){const _0x5bf18a=_0x13d2ef;if(_0x1dcd00){console[_0x5bf18a(0x8e)](_0x1dcd00);return;}_0x274737['CopyFolder'](_0x23972e,_0x45a364,_0x36a4fd);}):_0x274737[_0x13d2ef(0x74)](_0x23972e,_0x45a364,_0x36a4fd);});}),_0x162682[_0x124fb7(0x7b)]===0x0&&_0x1a747d&&_0x1a747d();});},exports[a24_0x3aac4d(0x74)]=(_0x5c2815,_0x54b415,_0x390d0c)=>{const _0x47138e=a24_0x3aac4d,_0xae3679=fs[_0x47138e(0x89)](_0x5c2815);_0xae3679['on']('error',function(_0x5412e0){const _0x5ee823=_0x47138e;_0x5412e0&&console[_0x5ee823(0x8e)](_0x5ee823(0x8b),_0x5c2815),_0x390d0c&&_0x390d0c(_0x5412e0);});const _0x242554=fs['createWriteStream'](_0x54b415);_0x242554['on']('error',function(_0xfc57cc){const _0x4b88b4=_0x47138e;_0xfc57cc&&console[_0x4b88b4(0x8e)]('write\x20error',_0x54b415),_0x390d0c&&_0x390d0c(_0xfc57cc);}),_0x242554['on'](_0x47138e(0x76),function(_0x177932){_0x390d0c&&_0x390d0c(_0x177932);}),_0xae3679[_0x47138e(0x78)](_0x242554);},exports[a24_0x3aac4d(0x7e)]=(_0x8f5968,_0x416256)=>{const _0x31393b=a24_0x3aac4d,_0x453432=this,_0xec5c78=fs[_0x31393b(0x91)](_0x8f5968);_0xec5c78[_0x31393b(0x8d)](_0x221b19=>{const _0x5a6f75=_0x31393b,_0x4259cf=_0x8f5968+'/'+_0x221b19,_0x5aa15c=fs['statSync'](_0x4259cf);_0x5aa15c['isDirectory']()?_0x453432[_0x5a6f75(0x7e)](_0x4259cf,_0x416256):_0x416256[_0x5a6f75(0x93)](_0x4259cf);});},exports[a24_0x3aac4d(0x8a)]=(_0x47220a,_0x3c1f9b)=>{return new Promise(_0x3264f7=>{const _0x3c9a21=a24_0x21cf,_0x441322=[];_0x3c1f9b[_0x3c9a21(0x8d)]((_0x346a3c,_0x1d20d1)=>{const _0x1b42b0=_0x3c9a21,_0x101b97=_0x47220a+'/'+_0x441322[_0x1b42b0(0x7a)]('/')+'/'+_0x346a3c;try{const _0x1fbee8=fs[_0x1b42b0(0x7c)](_0x101b97);_0x1fbee8[_0x1b42b0(0x83)]()?_0x1d20d1===_0x3c1f9b[_0x1b42b0(0x7b)]-0x1&&_0x3264f7():(fs[_0x1b42b0(0x88)](_0x101b97),_0x1d20d1===_0x3c1f9b[_0x1b42b0(0x7b)]-0x1&&_0x3264f7());}catch(_0x4515cf){fs[_0x1b42b0(0x88)](_0x101b97),_0x1d20d1===_0x3c1f9b['length']-0x1&&_0x3264f7();}_0x441322['push'](_0x346a3c);});});};