jjb-cmd 2.4.0 → 2.5.1

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.
package/src/rm-rf.js CHANGED
@@ -1 +1,52 @@
1
- const a5_0x35c5f5=a5_0x5e57;(function(_0x14cfef,_0xc3fd5f){const _0x52ebc4=a5_0x5e57,_0x9a27f4=_0x14cfef();while(!![]){try{const _0x12ba7b=-parseInt(_0x52ebc4(0x1a1))/0x1+-parseInt(_0x52ebc4(0x190))/0x2+parseInt(_0x52ebc4(0x193))/0x3+-parseInt(_0x52ebc4(0x1a4))/0x4+-parseInt(_0x52ebc4(0x192))/0x5+-parseInt(_0x52ebc4(0x19e))/0x6+parseInt(_0x52ebc4(0x1a5))/0x7;if(_0x12ba7b===_0xc3fd5f)break;else _0x9a27f4['push'](_0x9a27f4['shift']());}catch(_0x174427){_0x9a27f4['push'](_0x9a27f4['shift']());}}}(a5_0x5365,0x50e8f));const fs=require('fs'),path=require('path'),readline=require(a5_0x35c5f5(0x19a)),io=readline[a5_0x35c5f5(0x1a7)]({'input':process[a5_0x35c5f5(0x198)],'output':process[a5_0x35c5f5(0x19d)]});function a5_0x5e57(_0x91f5c0,_0x5ac7b4){const _0x536592=a5_0x5365();return a5_0x5e57=function(_0x5e5798,_0x8fc542){_0x5e5798=_0x5e5798-0x18f;let _0x904175=_0x536592[_0x5e5798];return _0x904175;},a5_0x5e57(_0x91f5c0,_0x5ac7b4);}module[a5_0x35c5f5(0x194)]=function(){const _0x2def0c=a5_0x35c5f5,_0xaa5e6e=path[_0x2def0c(0x199)]('./');io[_0x2def0c(0x19c)]('是否确认删除?删除后不可恢复![y/n]:',function(_0x23025c){const _0x285080=_0x2def0c;if(_0x23025c['trim']()==='y')console[_0x285080(0x1a6)]('正在计算项目数,请稍等...'),setTimeout(()=>{setTimeout(()=>{const _0x590c18=a5_0x5e57;console[_0x590c18(0x1a2)](),exec(_0xaa5e6e),setTimeout(()=>{const _0x4b7a96=_0x590c18;console[_0x4b7a96(0x1a6)](_0x4b7a96(0x19b)),console[_0x4b7a96(0x1a2)](),process['exit'](0x0);},0x1f4);},0x1f4);},0x1f4);else _0x23025c[_0x285080(0x19f)]()==='n'?(console[_0x285080(0x1a6)]('取消删除。'),process[_0x285080(0x18f)](0x0)):(console[_0x285080(0x1a6)]('无效操作。'),process['exit'](0x0));});};function a5_0x5365(){const _0x4e9107=['786704QdDbLA','9439031kFEsZp','log','createInterface','删除文件夹:','exit','818420KEWusD','删除异常:','1670075xESXcU','1239963IWuolJ','exports','readdirSync','unlinkSync','isDirectory','stdin','resolve','readline','删除完成。','question','stdout','1809144eBrszW','trim','existsSync','188922YqcqQZ','clear','statSync'];a5_0x5365=function(){return _0x4e9107;};return a5_0x5365();}function exec(_0x39257a){const _0x49678a=a5_0x35c5f5;if(fs[_0x49678a(0x1a0)](_0x39257a)){const _0x211994=fs[_0x49678a(0x195)](_0x39257a);for(let _0x5c9b39=0x0;_0x5c9b39<_0x211994['length'];_0x5c9b39++){const _0x3c5e3f=_0x211994[_0x5c9b39],_0x1906d8=_0x39257a+'/'+_0x3c5e3f;try{fs[_0x49678a(0x1a3)](_0x1906d8)[_0x49678a(0x197)]()?(exec(_0x1906d8),fs['rmdirSync'](_0x1906d8,{'recursive':!![]}),console[_0x49678a(0x1a6)](_0x49678a(0x1a8)+_0x1906d8)):(fs[_0x49678a(0x196)](_0x1906d8),console[_0x49678a(0x1a6)]('删除文件:'+_0x1906d8));}catch(_0x479a3e){console[_0x49678a(0x1a6)](_0x49678a(0x191)+_0x1906d8);}}}}
1
+ const path = require('path');
2
+ const readline = require('readline');
3
+ const {
4
+ logInfo,
5
+ logSuccess,
6
+ logError,
7
+ logWarning,
8
+ deleteFolderRecursive
9
+ } = require('./utils');
10
+
11
+ const io = readline.createInterface({
12
+ input: process.stdin,
13
+ output: process.stdout
14
+ });
15
+
16
+ /**
17
+ * 递归删除目录模块
18
+ * 危险操作:删除当前目录下的所有文件和文件夹
19
+ */
20
+ module.exports = function () {
21
+ const rootPath = path.resolve('./');
22
+
23
+ logWarning('⚠️ 危险操作:此命令将删除当前目录下的所有文件和文件夹!');
24
+ logWarning('⚠️ 删除后不可恢复,请谨慎操作!');
25
+
26
+ io.question('是否确认删除?删除后不可恢复![y/n]:', function (answer) {
27
+ const trimmedAnswer = answer.trim().toLowerCase();
28
+
29
+ if (trimmedAnswer === 'y' || trimmedAnswer === 'yes') {
30
+ logInfo('正在计算项目数,请稍等...');
31
+
32
+ setTimeout(() => {
33
+ try {
34
+ logInfo('开始删除操作...');
35
+ deleteFolderRecursive(rootPath);
36
+ logSuccess('删除完成。');
37
+ process.exit(0);
38
+ } catch (error) {
39
+ logError(`删除过程中发生错误:${error.message}`);
40
+ process.exit(1);
41
+ }
42
+ }, 1000);
43
+ } else if (trimmedAnswer === 'n' || trimmedAnswer === 'no') {
44
+ logInfo('取消删除。');
45
+ process.exit(0);
46
+ } else {
47
+ logError('无效操作,请输入 y 或 n。');
48
+ process.exit(1);
49
+ }
50
+ });
51
+ };
52
+
package/src/utils.js ADDED
@@ -0,0 +1,226 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const child_process = require('child_process');
4
+ const chalk = require('chalk');
5
+
6
+ // 常量定义
7
+ const CONSTANTS = {
8
+ MAX_BUFFER_SIZE: 1000000000, // 1GB
9
+ SYNC_DELAY: 1000, // 1秒
10
+ DEFAULT_BRANCH: 'master',
11
+ CONFIG_FILE_NAME: 'jjb.config.js',
12
+ BUILD_OUTPUT_DIR: 'dist',
13
+ TEMPLATES_PATH: 'start/src/main/resources/templates'
14
+ };
15
+
16
+
17
+ // 日志函数
18
+ function logInfo(message, path = '') {
19
+ console.log(chalk.blue(`Log: ${message}`), path);
20
+ }
21
+
22
+ function logSuccess(message) {
23
+ console.log(chalk.green(`Success: ${message}`));
24
+ }
25
+
26
+ function logWarning(message) {
27
+ console.log(chalk.yellow(`Warning: ${message}`));
28
+ }
29
+
30
+ function logError(message) {
31
+ console.log(chalk.red(`Error: ${message}`));
32
+ }
33
+
34
+ // 统一的命令执行函数
35
+ function executeCommand(command, cwd, options = {}) {
36
+ logInfo(`Sudo: ${command}`, cwd);
37
+ return child_process.execSync(command, { cwd, ...options });
38
+ }
39
+
40
+ // 文件处理函数
41
+ function deleteFolderRecursive(folderPath) {
42
+ if (fs.existsSync(folderPath)) {
43
+ fs.readdirSync(folderPath).forEach((file) => {
44
+ const curPath = path.join(folderPath, file);
45
+ if (fs.lstatSync(curPath).isDirectory()) {
46
+ // 递归删除子文件夹
47
+ deleteFolderRecursive(curPath);
48
+ } else {
49
+ // 删除文件
50
+ fs.unlinkSync(curPath);
51
+ }
52
+ });
53
+ // 删除空文件夹
54
+ fs.rmdirSync(folderPath);
55
+ }
56
+ }
57
+
58
+ // 检查文件是否存在
59
+ function fileExists(filePath) {
60
+ return fs.existsSync(filePath);
61
+ }
62
+
63
+ // 读取文件内容
64
+ function readFile(filePath, encoding = 'utf8') {
65
+ return fs.readFileSync(filePath, encoding);
66
+ }
67
+
68
+ // 写入文件内容
69
+ function writeFile(filePath, content, encoding = 'utf8') {
70
+ fs.writeFileSync(filePath, content, encoding);
71
+ }
72
+
73
+ // 创建目录
74
+ function createDir(dirPath) {
75
+ if (!fs.existsSync(dirPath)) {
76
+ fs.mkdirSync(dirPath, { recursive: true });
77
+ }
78
+ }
79
+
80
+ // 检查是否为 Vite 项目
81
+ function isViteProject(rootPath) {
82
+ return fileExists(path.join(rootPath, 'vite.config.js')) ||
83
+ fileExists(path.join(rootPath, 'vite.config.ts')) ||
84
+ fileExists(path.join(rootPath, 'vite.config.mjs'));
85
+ }
86
+
87
+ // 验证配置对象
88
+ function validateConfig(config, requiredFields) {
89
+ const missingFields = requiredFields.filter(field => !config[field]);
90
+ return {
91
+ isValid: missingFields.length === 0,
92
+ missingFields
93
+ };
94
+ }
95
+
96
+ // 验证环境配置
97
+ function validateEnvironment(config, environment) {
98
+ return config.environment && config.environment[environment];
99
+ }
100
+
101
+ /**
102
+ * @description 清空当前目录
103
+ * @param filePath
104
+ * @param callback
105
+ * @constructor
106
+ */
107
+ function DeleteDirAllFile(filePath, callback) {
108
+ let files = [];
109
+ if (fs.existsSync(filePath)) {
110
+ files = fs.readdirSync(filePath);
111
+ files.forEach(function (file, index) {
112
+ let curPath = path.join(filePath, file);
113
+ if (fs.statSync(curPath).isDirectory()) {
114
+ DeleteDirAllFile(curPath);
115
+ } else {
116
+ fs.unlinkSync(curPath);
117
+ }
118
+ });
119
+ fs.rmdirSync(filePath);
120
+ callback && callback();
121
+ } else {
122
+ callback && callback();
123
+ }
124
+ }
125
+
126
+ /**
127
+ * @description 复制单个文件
128
+ * @param srcFile
129
+ * @param tarFile
130
+ * @param cb
131
+ */
132
+ function CopyFile(srcFile, tarFile, cb) {
133
+ // 确保目标目录存在
134
+ const tarDir = path.dirname(tarFile);
135
+ if (!fs.existsSync(tarDir)) {
136
+ fs.mkdirSync(tarDir, { recursive: true });
137
+ }
138
+
139
+ const rs = fs.createReadStream(srcFile);
140
+ const ws = fs.createWriteStream(tarFile);
141
+
142
+ rs.pipe(ws);
143
+
144
+ ws.on('close', function() {
145
+ cb && cb();
146
+ });
147
+
148
+ ws.on('error', function(err) {
149
+ console.error('复制文件出错:', err);
150
+ cb && cb();
151
+ });
152
+ }
153
+
154
+ /**
155
+ * @description 复制文件夹及子目录文件
156
+ * @param srcDir
157
+ * @param tarDir
158
+ * @param cb
159
+ */
160
+ function CopyFolder(srcDir, tarDir, cb) {
161
+ // 确保目标目录存在
162
+ if (!fs.existsSync(tarDir)) {
163
+ fs.mkdirSync(tarDir, { recursive: true });
164
+ }
165
+
166
+ fs.readdir(srcDir, function (err, files) {
167
+
168
+ let count = 0;
169
+ const checkEnd = function () {
170
+ ++count === files.length && cb && cb();
171
+ };
172
+
173
+ if (err) {
174
+ checkEnd();
175
+ return;
176
+ }
177
+
178
+ files.forEach(function (file) {
179
+ const srcPath = path.join(srcDir, file);
180
+ const tarPath = path.join(tarDir, file);
181
+
182
+ fs.stat(srcPath, function (err, stats) {
183
+ if (stats.isDirectory()) {
184
+ fs.mkdir(tarPath, { recursive: true }, function (err) {
185
+ if (err) {
186
+ console.log(err);
187
+ return;
188
+ }
189
+
190
+ CopyFolder(srcPath, tarPath, checkEnd);
191
+ });
192
+ } else {
193
+ // 复制文件
194
+ const rs = fs.createReadStream(srcPath);
195
+ const ws = fs.createWriteStream(tarPath);
196
+ rs.pipe(ws);
197
+ ws.on('close', checkEnd);
198
+ ws.on('error', checkEnd);
199
+ }
200
+ });
201
+ });
202
+ //为空时直接回调
203
+ files.length === 0 && cb && cb();
204
+ });
205
+ }
206
+
207
+
208
+ module.exports = {
209
+ CONSTANTS,
210
+ logInfo,
211
+ logSuccess,
212
+ logWarning,
213
+ logError,
214
+ executeCommand,
215
+ deleteFolderRecursive,
216
+ fileExists,
217
+ readFile,
218
+ writeFile,
219
+ createDir,
220
+ isViteProject,
221
+ validateConfig,
222
+ validateEnvironment,
223
+ DeleteDirAllFile,
224
+ CopyFile,
225
+ CopyFolder
226
+ };
package/src/tools.js DELETED
@@ -1 +0,0 @@
1
- function a6_0x3a04(_0x323ad1,_0x472581){const _0x475d88=a6_0x475d();return a6_0x3a04=function(_0x3a04c8,_0x2619a8){_0x3a04c8=_0x3a04c8-0x1d2;let _0x564c72=_0x475d88[_0x3a04c8];return _0x564c72;},a6_0x3a04(_0x323ad1,_0x472581);}function a6_0x475d(){const _0x18f5ca=['701138YEhYgX','DeepScanner','jjb-common-lib','{\x22name\x22:\x22','【Error】:[jjb.config.json.installTarget]类型是一个string。','4ljQoKf','f_rm_rf','f_resolve_install_resources','join','projectType','_zip','\x5cjjb.config.json','readdirSync','rmdirSync','\x5cpackage.json','【Error】:[jjb.config.json]文件配置无效,需要installTarget属性。','stat','name','f_scan_jjb_config_json','existsSync','string','/api/v4/projects/','createReadStream','error','4104630uekeDP','read\x20error','vue-unisass-component','unlinkSync','f_create_package_json','dependencies','includes','installTarget','\x22,\x22main\x22:\x20\x22index.js\x22}','readdir','42VKLIbN','【Error】:[jjb.config.json.node_modules]配置无效,有效值<node_modules\x20|\x20src>。','replace','【Error】:[jjb.config.json]文件配置无效,需要projectType属性。','push','pipe','spa','mkdirSync','isArray','readFileSync','micro-spa','【Error】:[jjb.config.json.installResources]类型是一个Array<string>。','CreatePaths','log','f_pull_git_repository','react-admin-component','installResources','1021914oXQniB','\x22,\x22version\x22:\x22','【Error】:[jjb.config.json]文件配置无效,需要installResources属性。','1223253ihxQhf','toString','length','f_scan_jjb_config_json_rules','statSync','./config','【Error】:[jjb.config.json.projectType]类型是一个string。','4064259yDawIQ','jjb-dva-runtime','CopyFolder','jjb-common','writeFileSync','DeleteDirAllFile','parse','close','filter','7201850BGDuAG','exit','forEach','f_file_copy','projectId','/repository/archive.zip?private_token=','isDirectory','f_update_project_package_json','node_modules','f_content_replace','map','4560440ZfakCh','path'];a6_0x475d=function(){return _0x18f5ca;};return a6_0x475d();}const a6_0x2d98bb=a6_0x3a04;(function(_0x2b7fbf,_0xbbbc2b){const _0x56e2f3=a6_0x3a04,_0x2eb4a2=_0x2b7fbf();while(!![]){try{const _0x2b54f7=parseInt(_0x56e2f3(0x204))/0x1+parseInt(_0x56e2f3(0x221))/0x2+parseInt(_0x56e2f3(0x20b))/0x3*(-parseInt(_0x56e2f3(0x1d3))/0x4)+-parseInt(_0x56e2f3(0x214))/0x5+parseInt(_0x56e2f3(0x201))/0x6*(parseInt(_0x56e2f3(0x1f0))/0x7)+parseInt(_0x56e2f3(0x21f))/0x8+parseInt(_0x56e2f3(0x1e6))/0x9;if(_0x2b54f7===_0xbbbc2b)break;else _0x2eb4a2['push'](_0x2eb4a2['shift']());}catch(_0x4fc034){_0x2eb4a2['push'](_0x2eb4a2['shift']());}}}(a6_0x475d,0xc9d72));const fs=require('fs'),os=require('os'),path=require(a6_0x2d98bb(0x220)),{GIT_HOST,GIT_TEMP_DIR,CLOUD_PROJECT}=require(a6_0x2d98bb(0x209));exports['f_rm_rf']=function(_0xd6ef32){const _0x37d4e0=a6_0x2d98bb;if(fs['existsSync'](_0xd6ef32)){const _0x1ba257=fs[_0x37d4e0(0x1da)](_0xd6ef32);for(let _0x40b7fc=0x0;_0x40b7fc<_0x1ba257[_0x37d4e0(0x206)];_0x40b7fc++){const _0x2a97de=_0x1ba257[_0x40b7fc],_0x2d82dd=_0xd6ef32+'/'+_0x2a97de;fs[_0x37d4e0(0x208)](_0x2d82dd)[_0x37d4e0(0x21a)]()?(exports[_0x37d4e0(0x1d4)](_0x2d82dd),fs[_0x37d4e0(0x1db)](_0x2d82dd)):fs[_0x37d4e0(0x1e9)](_0x2d82dd);}}},exports[a6_0x2d98bb(0x1fe)]=function(_0x53ae6a=[]){return _0x53ae6a['map'](_0x4ce1f8=>{const _0x1675fe=a6_0x3a04,_0x567907=CLOUD_PROJECT[_0x4ce1f8['name']]||undefined,_0x122b76=os['tmpdir']();return{'path':_0x122b76+'\x5c'+GIT_TEMP_DIR+'\x5c'+_0x4ce1f8[_0x1675fe(0x1df)]+'.zip','compress':_0x122b76+'\x5c'+GIT_TEMP_DIR+'\x5c'+_0x4ce1f8[_0x1675fe(0x1df)]+_0x1675fe(0x1d8),'repository':GIT_HOST+_0x1675fe(0x1e3)+_0x567907[_0x1675fe(0x218)]+_0x1675fe(0x219)+_0x567907['token']+'&ref=master'};});},exports[a6_0x2d98bb(0x1e0)]=function(_0x24f274){const _0x52549f=a6_0x2d98bb;return fs[_0x52549f(0x1e1)](_0x24f274+_0x52549f(0x1d9));},exports[a6_0x2d98bb(0x207)]=function(_0x3b039a){const _0x3e754d=a6_0x2d98bb;let _0x224751={};try{_0x224751=JSON[_0x3e754d(0x211)](fs[_0x3e754d(0x1f9)](_0x3b039a+_0x3e754d(0x1d9))[_0x3e754d(0x205)]());}catch(_0x294978){console['log']('【Error】:[jjb.config.json]文件解析失败,请确认是否配置正确。'),process[_0x3e754d(0x215)](0x0);}!(_0x3e754d(0x1d7)in _0x224751)&&(console[_0x3e754d(0x1fd)](_0x3e754d(0x1f3)),process[_0x3e754d(0x215)](0x0));!('installTarget'in _0x224751)&&(console['log'](_0x3e754d(0x1dd)),process['exit'](0x0));!(_0x3e754d(0x200)in _0x224751)&&(console[_0x3e754d(0x1fd)](_0x3e754d(0x203)),process[_0x3e754d(0x215)](0x0));typeof _0x224751[_0x3e754d(0x1d7)]!==_0x3e754d(0x1e2)&&(console[_0x3e754d(0x1fd)](_0x3e754d(0x20a)),process[_0x3e754d(0x215)](0x0));!['multi',_0x3e754d(0x1f6),'uniapp',_0x3e754d(0x1fa)][_0x3e754d(0x1ec)](_0x224751['projectType'])&&(console[_0x3e754d(0x1fd)]('【Error】:[jjb.config.json.projectType]配置无效,有效值<multi\x20|\x20spa\x20|\x20micro-spa\x20|\x20uniapp>。'),process[_0x3e754d(0x215)](0x0));typeof _0x224751[_0x3e754d(0x1ed)]!==_0x3e754d(0x1e2)&&(console[_0x3e754d(0x1fd)](_0x3e754d(0x1d2)),process[_0x3e754d(0x215)](0x0));![_0x3e754d(0x21c),'src'][_0x3e754d(0x1ec)](_0x224751[_0x3e754d(0x1ed)])&&(console[_0x3e754d(0x1fd)](_0x3e754d(0x1f1)),process[_0x3e754d(0x215)](0x0));!Array['isArray'](_0x224751[_0x3e754d(0x200)])&&(console['log'](_0x3e754d(0x1fb)),process[_0x3e754d(0x215)](0x0));_0x224751[_0x3e754d(0x200)]['length']===0x0&&(console[_0x3e754d(0x1fd)]('【Error】:[jjb.config.json.installResources]无资源。'),process[_0x3e754d(0x215)](0x0));const _0x1e5a0c=exports[_0x3e754d(0x1d5)](_0x224751[_0x3e754d(0x200)]);return _0x1e5a0c[_0x3e754d(0x21e)](_0x27f4d1=>_0x27f4d1[_0x3e754d(0x1df)])[_0x3e754d(0x213)](_0x29884b=>![_0x3e754d(0x20e),_0x3e754d(0x20c),_0x3e754d(0x223),'jjb-common-decorator',_0x3e754d(0x1ff),_0x3e754d(0x1e8)][_0x3e754d(0x1ec)](_0x29884b))['length']!==0x0&&(console['log']('【Error】:[jjb.config.json.installResources]配置无效,有效值<common\x20|\x20react-admin-component\x20|\x20vue-unisass-component\x20|\x20jjb-common-decorator\x20|\x20jjb-dva-runtime\x20|\x20jjb-common-lib>。'),process[_0x3e754d(0x215)](0x0)),_0x224751[_0x3e754d(0x200)]=_0x1e5a0c,_0x224751;},exports[a6_0x2d98bb(0x1ea)]=function(_0x1636dd,_0x5ed53d,_0x565969){const _0x199154=a6_0x2d98bb;fs[_0x199154(0x20f)](_0x1636dd+_0x199154(0x1dc),_0x199154(0x224)+_0x5ed53d+_0x199154(0x202)+_0x565969+_0x199154(0x1ee));},exports['f_resolve_install_resources']=function(_0x862926=[]){const _0x23ef0f=a6_0x2d98bb,_0x53762c=[];return Array[_0x23ef0f(0x1f8)](_0x862926)&&_0x862926[_0x23ef0f(0x216)](_0x52d09b=>{const _0x2dea00=_0x23ef0f;if(Array['isArray'](_0x52d09b)){const [_0xaa1793,_0x5e0b72=[]]=_0x52d09b;_0x53762c[_0x2dea00(0x1f4)]({'name':_0xaa1793,'importList':_0x5e0b72});}else _0x53762c[_0x2dea00(0x1f4)]({'name':_0x52d09b,'importList':[]});}),_0x53762c;},exports[a6_0x2d98bb(0x21b)]=function(_0x58cd31,_0x18a6bb,_0x30aefe){const _0x3171b6=a6_0x2d98bb,_0x88f5c1=JSON[_0x3171b6(0x211)](fs[_0x3171b6(0x1f9)](_0x58cd31)[_0x3171b6(0x205)]());_0x88f5c1[_0x3171b6(0x1eb)][_0x18a6bb]=_0x30aefe,fs[_0x3171b6(0x20f)](_0x58cd31,JSON['stringify'](_0x88f5c1,null,0x2));},exports[a6_0x2d98bb(0x217)]=function(_0x33e4ab,_0x5b5cdd){const _0xec7b9b=a6_0x2d98bb;fs[_0xec7b9b(0x1da)](_0x33e4ab)[_0xec7b9b(0x216)](_0x3b8af3=>{const _0x5e40a7=_0xec7b9b,_0x47377b=_0x33e4ab+'\x5c'+_0x3b8af3,_0x593282=_0x5b5cdd+'\x5c'+_0x3b8af3;fs[_0x5e40a7(0x208)](_0x47377b)['isDirectory']()?(fs['mkdirSync'](_0x593282),exports[_0x5e40a7(0x217)](_0x47377b,_0x593282)):fs['writeFileSync'](_0x593282,fs[_0x5e40a7(0x1f9)](_0x47377b)[_0x5e40a7(0x205)]());});},exports[a6_0x2d98bb(0x21d)]=function(_0x3ad1e0=[],_0x5cda9b){const _0x2e4f30=a6_0x2d98bb;_0x3ad1e0[_0x2e4f30(0x216)](_0x49ed33=>{const _0x5c716e=_0x2e4f30,_0x28ae41=_0x5cda9b+_0x49ed33[_0x5c716e(0x220)];if(fs[_0x5c716e(0x1e1)](_0x28ae41)){let _0x14aa32=fs[_0x5c716e(0x1f9)](_0x28ae41)['toString']();_0x49ed33[_0x5c716e(0x1f2)][_0x5c716e(0x216)](_0x3aba70=>{_0x14aa32=_0x14aa32['replace'](_0x3aba70[0x0],_0x3aba70[0x1]);}),fs[_0x5c716e(0x20f)](_0x28ae41,_0x14aa32);}});},exports[a6_0x2d98bb(0x210)]=(_0x3ab7ea,_0x28e425)=>{const _0xd3a3dd=a6_0x2d98bb;let _0x491f6c=[];const _0x33f235=this;fs['existsSync'](_0x3ab7ea)?(_0x491f6c=fs[_0xd3a3dd(0x1da)](_0x3ab7ea),_0x491f6c[_0xd3a3dd(0x216)](function(_0x458f80,_0x3718f6){const _0x5d79a1=_0xd3a3dd;let _0x32504f=_0x3ab7ea+'/'+_0x458f80;fs['statSync'](_0x32504f)[_0x5d79a1(0x21a)]()?_0x33f235['DeleteDirAllFile'](_0x32504f):fs[_0x5d79a1(0x1e9)](_0x32504f);}),fs['rmdirSync'](_0x3ab7ea),_0x28e425&&_0x28e425()):_0x28e425&&_0x28e425();},exports['CopyFolder']=(_0x5ec054,_0x1c1b7e,_0x37725b)=>{const _0x7c553a=a6_0x2d98bb,_0x22d29b=this;fs[_0x7c553a(0x1ef)](_0x5ec054,function(_0x3fb7da,_0x1db27c){const _0x47c312=_0x7c553a;let _0x402dd7=0x0;const _0x41ba4c=function(){const _0x5c8019=a6_0x3a04;++_0x402dd7===_0x1db27c[_0x5c8019(0x206)]&&_0x37725b&&_0x37725b();};if(_0x3fb7da){_0x41ba4c();return;}_0x1db27c[_0x47c312(0x216)](function(_0x4cda27){const _0x597472=_0x47c312,_0x56ba22=path[_0x597472(0x1d6)](_0x5ec054,_0x4cda27),_0x1bf8fc=path[_0x597472(0x1d6)](_0x1c1b7e,_0x4cda27);fs[_0x597472(0x1de)](_0x56ba22,function(_0x4d5dd3,_0x2f3d40){const _0x3146b3=_0x597472;_0x2f3d40[_0x3146b3(0x21a)]()?fs['mkdir'](_0x1bf8fc,function(_0x2bf7e0){const _0x37f509=_0x3146b3;if(_0x2bf7e0){console[_0x37f509(0x1fd)](_0x2bf7e0);return;}_0x22d29b[_0x37f509(0x20d)](_0x56ba22,_0x1bf8fc,_0x41ba4c);}):_0x22d29b['CopyFile'](_0x56ba22,_0x1bf8fc,_0x41ba4c);});}),_0x1db27c[_0x47c312(0x206)]===0x0&&_0x37725b&&_0x37725b();});},exports['CopyFile']=(_0x45e670,_0x224fc1,_0x31cce8)=>{const _0x223265=a6_0x2d98bb,_0x8c7086=fs[_0x223265(0x1e4)](_0x45e670);_0x8c7086['on'](_0x223265(0x1e5),function(_0x1efd64){const _0x19c62d=_0x223265;_0x1efd64&&console[_0x19c62d(0x1fd)](_0x19c62d(0x1e7),_0x45e670),_0x31cce8&&_0x31cce8(_0x1efd64);});const _0x7873fc=fs['createWriteStream'](_0x224fc1);_0x7873fc['on'](_0x223265(0x1e5),function(_0x70c028){_0x70c028&&console['log']('write\x20error',_0x224fc1),_0x31cce8&&_0x31cce8(_0x70c028);}),_0x7873fc['on'](_0x223265(0x212),function(_0x192b4f){_0x31cce8&&_0x31cce8(_0x192b4f);}),_0x8c7086[_0x223265(0x1f5)](_0x7873fc);},exports[a6_0x2d98bb(0x222)]=(_0x24afd2,_0x407887)=>{const _0x4d919c=a6_0x2d98bb,_0x13ee5e=this,_0x349b9a=fs[_0x4d919c(0x1da)](_0x24afd2);_0x349b9a['forEach'](_0x595fc1=>{const _0x10e64d=_0x4d919c,_0x322e27=_0x24afd2+'/'+_0x595fc1,_0x3040a2=fs[_0x10e64d(0x208)](_0x322e27);_0x3040a2[_0x10e64d(0x21a)]()?_0x13ee5e[_0x10e64d(0x222)](_0x322e27,_0x407887):_0x407887[_0x10e64d(0x1f4)](_0x322e27);});},exports[a6_0x2d98bb(0x1fc)]=(_0x4a3fd9,_0x4b1851)=>{return new Promise(_0x1e1f90=>{const _0x1012a9=[];_0x4b1851['forEach']((_0x53b6c8,_0x349766)=>{const _0x254df3=a6_0x3a04,_0x486c49=_0x4a3fd9+'/'+_0x1012a9[_0x254df3(0x1d6)]('/')+'/'+_0x53b6c8;try{const _0x2f7897=fs[_0x254df3(0x208)](_0x486c49);_0x2f7897[_0x254df3(0x21a)]()?_0x349766===_0x4b1851['length']-0x1&&_0x1e1f90():(fs[_0x254df3(0x1f7)](_0x486c49),_0x349766===_0x4b1851[_0x254df3(0x206)]-0x1&&_0x1e1f90());}catch(_0x18aceb){fs[_0x254df3(0x1f7)](_0x486c49),_0x349766===_0x4b1851['length']-0x1&&_0x1e1f90();}_0x1012a9['push'](_0x53b6c8);});});};
package/src/version.js DELETED
@@ -1 +0,0 @@
1
- function a6_0x1c8a(_0x2566f3,_0x262ab0){const _0x369cb7=a6_0x369c();return a6_0x1c8a=function(_0x1c8ac2,_0x252c6e){_0x1c8ac2=_0x1c8ac2-0x72;let _0x1444ba=_0x369cb7[_0x1c8ac2];return _0x1444ba;},a6_0x1c8a(_0x2566f3,_0x262ab0);}const a6_0x123a7c=a6_0x1c8a;function a6_0x369c(){const _0x5c00b5=['post','log','/api/file/version','exit','parse','网络异常。','6rcMBMt','4540UQBWwO','data','8008080kpcUSy','75878tTNCbn','existsSync','then','1236924CPPyWD','28gcimhN','548147dzzdhR','catch','\x5cpackage.json','./config','917945nPKIFC','查询失败!根目录缺少‘package.json’文件,无法完成查询。','toString','8217993XgmAVm','2199375OXHGFY','6qOnJAE'];a6_0x369c=function(){return _0x5c00b5;};return a6_0x369c();}(function(_0x5517f3,_0x5d7f2b){const _0x29c589=a6_0x1c8a,_0x343f18=_0x5517f3();while(!![]){try{const _0x400b4f=parseInt(_0x29c589(0x7e))/0x1*(-parseInt(_0x29c589(0x75))/0x2)+parseInt(_0x29c589(0x86))/0x3+parseInt(_0x29c589(0x7d))/0x4*(-parseInt(_0x29c589(0x82))/0x5)+-parseInt(_0x29c589(0x87))/0x6*(parseInt(_0x29c589(0x85))/0x7)+parseInt(_0x29c589(0x78))/0x8+parseInt(_0x29c589(0x7c))/0x9+parseInt(_0x29c589(0x76))/0xa*(parseInt(_0x29c589(0x79))/0xb);if(_0x400b4f===_0x5d7f2b)break;else _0x343f18['push'](_0x343f18['shift']());}catch(_0x4f3216){_0x343f18['push'](_0x343f18['shift']());}}}(a6_0x369c,0xdba74));const path=require('path'),fs=require('fs'),axios=require('axios'),{getApiHost}=require(a6_0x123a7c(0x81));module['exports']=()=>{const _0x5cdb1e=a6_0x123a7c,_0x16efd8=path['resolve']('./'),_0x4f3501=_0x16efd8+_0x5cdb1e(0x80);if(fs[_0x5cdb1e(0x7a)](_0x4f3501)){const _0x39e8a7=JSON[_0x5cdb1e(0x73)](fs['readFileSync'](_0x4f3501)[_0x5cdb1e(0x84)]()),{name:_0x4e3f8b}=_0x39e8a7;axios[_0x5cdb1e(0x88)](getApiHost()+_0x5cdb1e(0x8a),{'package_name':_0x4e3f8b})[_0x5cdb1e(0x7b)](_0x5374eb=>{const _0x2684af=_0x5cdb1e;_0x5374eb[_0x2684af(0x77)]['status']?console['log'](_0x5374eb[_0x2684af(0x77)][_0x2684af(0x77)]):console[_0x2684af(0x89)](_0x5374eb[_0x2684af(0x77)]['message']),process['exit'](0x0);})[_0x5cdb1e(0x7f)](()=>{const _0x192cf1=_0x5cdb1e;console[_0x192cf1(0x89)](_0x192cf1(0x74)),process[_0x192cf1(0x72)](0x0);});}else console[_0x5cdb1e(0x89)](_0x5cdb1e(0x83)),process['exit'](0x0);};