jjb-cmd 2.2.3 → 2.2.4

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,148 +1 @@
1
- const fs = require('fs');
2
- const os = require('os');
3
- const path = require('path');
4
- const child_process = require('child_process');
5
- const { CopyFolder, DeleteDirAllFile } = require('../../old/util');
6
- const { GIT_TEMP_JAVA, GIT_JAVA_ENV_JSON, getApiHost } = require("../cmd.install/config");
7
- const axios = require("axios");
8
-
9
- module.exports = arguments => {
10
-
11
- const authPath = path.join(__dirname, '../../../.auth');
12
- if (!fs.existsSync(authPath)) {
13
- console.log(`【Error】:no auth login`);
14
- process.exit(0);
15
- }
16
-
17
- /**
18
- * 环境
19
- */
20
- const environment = arguments[1];
21
-
22
- /**
23
- * 描述
24
- */
25
- const describe = arguments[2] || '"no message"';
26
-
27
- /**
28
- * 当前根路径
29
- * @type {Promise<void> | Promise<string>}
30
- */
31
- const root_path = path.resolve('./');
32
-
33
- /**
34
- * jjb配置文件路径
35
- * @type {string}
36
- */
37
- const config_json_path = `${root_path}\\jjb.config.js`;
38
-
39
- /**
40
- * 打包输出目录
41
- * @type {string}
42
- */
43
- const build_output_dir = `${root_path}\\dist`;
44
-
45
- /**
46
- * 临时目录
47
- */
48
- const tmpdir = os.tmpdir();
49
-
50
- const [username , password] = fs.readFileSync(authPath).toString().split('/');
51
- axios.post(`${getApiHost()}/api/auth`, {
52
- username,
53
- password
54
- }).then(res => {
55
- if (res.data.status) {
56
- if (fs.existsSync(config_json_path)) {
57
- const jjbConfig = require(config_json_path);
58
- // const config_json_file = JSON.parse(fs.readFileSync(config_json_path).toString());
59
- if (jjbConfig.javaGit) {
60
- const tempGit = tmpdir + '/' + GIT_TEMP_JAVA;
61
- if (!fs.existsSync(tempGit)) {
62
- fs.mkdirSync(tempGit);
63
- }
64
- const projectDir = `${tempGit}/${jjbConfig.javaGitName}`;
65
- if (!fs.existsSync(projectDir)) {
66
- child_process.execSync(`git clone ${jjbConfig.javaGit}`, {cwd: tempGit});
67
- } else {
68
- if (arguments[3] && "force" === arguments[3]) {
69
- DeleteDirAllFile(projectDir, () => child_process.execSync(`git clone ${jjbConfig.javaGit}`, {cwd: tempGit}));
70
- }
71
- }
72
- project_sync(tempGit, jjbConfig);
73
- } else {
74
- console.log('【Error】:no setting git');
75
- }
76
- }
77
- } else {
78
- console.log('Auth Fail!');
79
- }
80
- }).catch(e => {
81
- console.log(e)
82
- console.log('Auth NetWork Fail!');
83
- });
84
-
85
- if (arguments.length < 2) {
86
- console.log('【Error】:参数传递错误');
87
- process.exit(0);
88
- }
89
-
90
- /**
91
- * 项目git同步
92
- */
93
- function project_sync (tempGit, jjbConfig) {
94
- const envData = jjbConfig.environment[environment];
95
- const projectDir = `${tempGit}/${jjbConfig.javaGitName}`;
96
- if (!fs.existsSync(projectDir)) {
97
- console.log('【Error】:no setting javaGitName');
98
- process.exit(0);
99
- }
100
- child_process.execSync(`git pull`, { cwd: projectDir });
101
- if (!fs.existsSync(root_path + '/node_modules')) {
102
- console.log('【warning】:Git Pull Done,yarn install project,please wait...');
103
- child_process.execSync(`yarn`, { cwd: root_path });
104
- console.log('yarn install Done!');
105
- } else {
106
- console.log(`Git Pull Done,yarn build:${environment},please wait...`);
107
- }
108
- child_process.execSync(`yarn build:${environment}`, { cwd: root_path, maxBuffer: 1000000000 });
109
- console.log('Project build Done,copy project,please wait...');
110
- if (fs.existsSync(build_output_dir)) {
111
- const appIdentifier = jjbConfig.appIdentifier;
112
- const indexContent = fs.readFileSync(build_output_dir + '/index.html');
113
- fs.writeFileSync(build_output_dir + '/' + appIdentifier + '.html', indexContent, 'utf-8');
114
- if (arguments[4] && arguments[4] === 'index') {
115
- fs.writeFileSync(build_output_dir + '/index.html', indexContent, 'utf-8');
116
- }
117
- // const tempJavaPath = `${projectDir}/src/main/resources/templates/${GIT_JAVA_ENV_JSON[environment]}`;
118
- const tempJavaPath = `${projectDir}/start/src/main/resources/templates`;
119
- if (!fs.existsSync(tempJavaPath)) {
120
- fs.mkdirSync(tempJavaPath);
121
- }
122
- child_process.execSync(`git checkout ${envData.javaGitBranch ? envData.javaGitBranch : 'master'}`, { cwd: projectDir });
123
- const projectJavaPath = tempJavaPath + '/' + jjbConfig.appIdentifier;
124
- DeleteDirAllFile(projectJavaPath, () => {
125
- fs.mkdirSync(projectJavaPath);
126
- fs.writeFileSync(projectJavaPath+'.html', indexContent, 'utf-8');
127
- CopyFolder(build_output_dir + '\\' +jjbConfig.appIdentifier, projectJavaPath, () => {
128
- console.log('Dist output copy Done,git add,please wait...', `git checkout ${jjbConfig.javaGitBranch ? jjbConfig.javaGitBranch : 'master'}`);
129
- setTimeout(() => {
130
- child_process.execSync(`git add .`, { cwd: projectDir });
131
- console.log('Git Add Done,git commit,please wait...');
132
- try {
133
- child_process.execSync(`git commit -m ${describe} --no-verify`, { cwd: projectDir });
134
- console.log('Git Commit Done,git push,please wait...');
135
- } catch (e) {
136
- console.log('【warning】:no commit,git push,please wait...');
137
- }
138
- child_process.execSync(`git push --force`, { cwd: projectDir });
139
- console.log('Git Push Done!');
140
- }, 1000);
141
- });
142
- });
143
- } else {
144
- console.log('【Error】:打包失败,没有dist目录!');
145
- }
146
- }
147
-
148
- };
1
+ function a9_0x5e11(){const _0x235ade=['.html','git\x20push\x20--force','32TOglcX','resolve','writeFileSync','master','3413940KMkFQo','/api/auth','../../../.auth','data','186912cFsxWH','Auth\x20NetWork\x20Fail!','git\x20commit\x20-m\x20','80895WLHhBE','git\x20add\x20.','readFileSync','length','Git\x20Push\x20Done!','child_process','【Error】:参数传递错误','yarn\x20build:','git\x20pull','Auth\x20Fail!','10OHxgiw','path','359307jXCRHG','log','utf-8','/start/src/main/resources/templates','split','appIdentifier','git\x20clone\x20','git\x20checkout\x20','execSync','【warning】:Git\x20Pull\x20Done,yarn\x20install\x20project,please\x20wait...','Git\x20Pull\x20Done,yarn\x20build:','610258CeNzOV','exit','Project\x20build\x20Done,copy\x20project,please\x20wait...','\x22no\x20message\x22','exports','post','Git\x20Commit\x20Done,git\x20push,please\x20wait...','tmpdir','status','index','../cmd.install/config','Git\x20Add\x20Done,git\x20commit,please\x20wait...','\x5cdist','/index.html','【Error】:no\x20setting\x20javaGitName','javaGitName','../../old/util','【Error】:no\x20setting\x20git','includes','environment','2322131YFklbQ','javaGit','【Error】:打包失败,没有dist目录!','10atPNcm','【warning】:no\x20commit,git\x20push,please\x20wait...','yarn','【Error】:no\x20auth\x20login','84SWUQQn','11775OZDakf','existsSync','force','mkdirSync','javaGitBranch','toString','axios'];a9_0x5e11=function(){return _0x235ade;};return a9_0x5e11();}function a9_0x19f2(_0x55408b,_0x407d16){const _0x5e11e6=a9_0x5e11();return a9_0x19f2=function(_0x19f233,_0x4e5a68){_0x19f233=_0x19f233-0x17b;let _0x477a26=_0x5e11e6[_0x19f233];return _0x477a26;},a9_0x19f2(_0x55408b,_0x407d16);}const a9_0x23f82c=a9_0x19f2;(function(_0x376807,_0x392cb7){const _0x34719b=a9_0x19f2,_0x183a8f=_0x376807();while(!![]){try{const _0x243da3=-parseInt(_0x34719b(0x19d))/0x1+parseInt(_0x34719b(0x1bf))/0x2*(-parseInt(_0x34719b(0x17d))/0x3)+parseInt(_0x34719b(0x17c))/0x4*(-parseInt(_0x34719b(0x191))/0x5)+parseInt(_0x34719b(0x18a))/0x6+parseInt(_0x34719b(0x1bc))/0x7+parseInt(_0x34719b(0x186))/0x8*(parseInt(_0x34719b(0x18e))/0x9)+-parseInt(_0x34719b(0x19b))/0xa*(-parseInt(_0x34719b(0x1a8))/0xb);if(_0x243da3===_0x392cb7)break;else _0x183a8f['push'](_0x183a8f['shift']());}catch(_0x3c55d4){_0x183a8f['push'](_0x183a8f['shift']());}}}(a9_0x5e11,0x4e446));const fs=require('fs'),os=require('os'),path=require(a9_0x23f82c(0x19c)),child_process=require(a9_0x23f82c(0x196)),{CopyFolder,DeleteDirAllFile}=require(a9_0x23f82c(0x1b8)),{GIT_TEMP_JAVA,GIT_JAVA_ENV_JSON,getApiHost}=require(a9_0x23f82c(0x1b2)),axios=require(a9_0x23f82c(0x183));module[a9_0x23f82c(0x1ac)]=arguments=>{const _0x56dc3d=a9_0x23f82c,_0x11ae34=path['join'](__dirname,_0x56dc3d(0x18c));!fs[_0x56dc3d(0x17e)](_0x11ae34)&&(console[_0x56dc3d(0x19e)](_0x56dc3d(0x17b)),process[_0x56dc3d(0x1a9)](0x0));const _0x51076b=arguments[0x1],_0x3b11af=arguments[0x2]||_0x56dc3d(0x1ab),_0x1af494=arguments[0x3]?arguments[0x3]['split']('|'):[],_0x1100f0=path[_0x56dc3d(0x187)]('./'),_0x532c56=_0x1100f0+'\x5cjjb.config.js',_0x3f6208=_0x1100f0+_0x56dc3d(0x1b4),_0x2cf5d8=os[_0x56dc3d(0x1af)](),[_0x1399c0,_0x4ab0fa]=fs[_0x56dc3d(0x193)](_0x11ae34)[_0x56dc3d(0x182)]()[_0x56dc3d(0x1a1)]('/');axios[_0x56dc3d(0x1ad)](getApiHost()+_0x56dc3d(0x18b),{'username':_0x1399c0,'password':_0x4ab0fa})['then'](_0x3ec0de=>{const _0x44e2fb=_0x56dc3d;if(_0x3ec0de[_0x44e2fb(0x18d)][_0x44e2fb(0x1b0)]){if(fs[_0x44e2fb(0x17e)](_0x532c56)){const _0x188fbf=require(_0x532c56);if(_0x188fbf[_0x44e2fb(0x1bd)]){const _0x518a1b=_0x2cf5d8+'/'+GIT_TEMP_JAVA;!fs[_0x44e2fb(0x17e)](_0x518a1b)&&fs['mkdirSync'](_0x518a1b);const _0x4270a1=_0x518a1b+'/'+_0x188fbf[_0x44e2fb(0x1b7)];!fs[_0x44e2fb(0x17e)](_0x4270a1)?child_process[_0x44e2fb(0x1a5)](_0x44e2fb(0x1a3)+_0x188fbf[_0x44e2fb(0x1bd)],{'cwd':_0x518a1b}):_0x1af494[_0x44e2fb(0x1ba)](_0x44e2fb(0x17f))?DeleteDirAllFile(_0x4270a1,()=>child_process[_0x44e2fb(0x1a5)](_0x44e2fb(0x1a3)+_0x188fbf[_0x44e2fb(0x1bd)],{'cwd':_0x518a1b})):child_process['execSync'](_0x44e2fb(0x1a3)+_0x188fbf[_0x44e2fb(0x1bd)],{'cwd':_0x518a1b}),_0x26edb1(_0x518a1b,_0x188fbf);}else console[_0x44e2fb(0x19e)](_0x44e2fb(0x1b9));}}else console[_0x44e2fb(0x19e)](_0x44e2fb(0x19a));})['catch'](_0x3a184d=>{const _0x2fd364=_0x56dc3d;console[_0x2fd364(0x19e)](_0x3a184d),console[_0x2fd364(0x19e)](_0x2fd364(0x18f));});arguments[_0x56dc3d(0x194)]<0x2&&(console[_0x56dc3d(0x19e)](_0x56dc3d(0x197)),process[_0x56dc3d(0x1a9)](0x0));function _0x26edb1(_0x5d488b,_0x5e9389){const _0x42aa09=_0x56dc3d,_0x28514c=_0x5e9389[_0x42aa09(0x1bb)][_0x51076b],_0x2d6ca2=_0x5d488b+'/'+_0x5e9389[_0x42aa09(0x1b7)];!fs[_0x42aa09(0x17e)](_0x2d6ca2)&&(console[_0x42aa09(0x19e)](_0x42aa09(0x1b6)),process[_0x42aa09(0x1a9)](0x0));child_process[_0x42aa09(0x1a5)](_0x42aa09(0x199),{'cwd':_0x2d6ca2});!fs[_0x42aa09(0x17e)](_0x1100f0+'/node_modules')?(console[_0x42aa09(0x19e)](_0x42aa09(0x1a6)),child_process['execSync'](_0x42aa09(0x1c1),{'cwd':_0x1100f0}),console[_0x42aa09(0x19e)]('yarn\x20install\x20Done!')):console[_0x42aa09(0x19e)](_0x42aa09(0x1a7)+_0x51076b+',please\x20wait...');child_process[_0x42aa09(0x1a5)](_0x42aa09(0x198)+_0x51076b,{'cwd':_0x1100f0,'maxBuffer':0x3b9aca00}),console[_0x42aa09(0x19e)](_0x42aa09(0x1aa));if(fs[_0x42aa09(0x17e)](_0x3f6208)){const _0x2c2d4f=_0x5e9389[_0x42aa09(0x1a2)],_0x3411b3=fs[_0x42aa09(0x193)](_0x3f6208+_0x42aa09(0x1b5));fs[_0x42aa09(0x188)](_0x3f6208+'/'+_0x2c2d4f+_0x42aa09(0x184),_0x3411b3,_0x42aa09(0x19f));_0x1af494[_0x42aa09(0x1ba)](_0x42aa09(0x1b1))&&fs[_0x42aa09(0x188)](_0x3f6208+'/index.html',_0x3411b3,_0x42aa09(0x19f));const _0x40c356=_0x2d6ca2+_0x42aa09(0x1a0);!fs['existsSync'](_0x40c356)&&fs[_0x42aa09(0x180)](_0x40c356);child_process[_0x42aa09(0x1a5)](_0x42aa09(0x1a4)+(_0x28514c[_0x42aa09(0x181)]?_0x28514c['javaGitBranch']:_0x42aa09(0x189)),{'cwd':_0x2d6ca2});const _0x31a912=_0x40c356+'/'+_0x5e9389[_0x42aa09(0x1a2)];DeleteDirAllFile(_0x31a912,()=>{const _0x4a26ee=_0x42aa09;fs[_0x4a26ee(0x180)](_0x31a912),fs['writeFileSync'](_0x31a912+_0x4a26ee(0x184),_0x3411b3,_0x4a26ee(0x19f)),CopyFolder(_0x3f6208+'\x5c'+_0x5e9389[_0x4a26ee(0x1a2)],_0x31a912,()=>{const _0x21edb7=_0x4a26ee;console['log']('Dist\x20output\x20copy\x20Done,git\x20add,please\x20wait...','git\x20checkout\x20'+(_0x5e9389['javaGitBranch']?_0x5e9389[_0x21edb7(0x181)]:_0x21edb7(0x189))),setTimeout(()=>{const _0x139903=_0x21edb7;child_process[_0x139903(0x1a5)](_0x139903(0x192),{'cwd':_0x2d6ca2}),console['log'](_0x139903(0x1b3));try{child_process[_0x139903(0x1a5)](_0x139903(0x190)+_0x3b11af+'\x20--no-verify',{'cwd':_0x2d6ca2}),console[_0x139903(0x19e)](_0x139903(0x1ae));}catch(_0x5a02a3){console['log'](_0x139903(0x1c0));}child_process[_0x139903(0x1a5)](_0x139903(0x185),{'cwd':_0x2d6ca2}),console[_0x139903(0x19e)](_0x139903(0x195));},0x3e8);});});}else console['log'](_0x42aa09(0x1be));}};
@@ -1,205 +1 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const os = require('os');
4
- const axios = require('axios');
5
- const readline = require('readline');
6
- const io = readline.createInterface({
7
- input: process.stdin,
8
- output: process.stdout
9
- });
10
- const child_process = require('child_process');
11
-
12
- module.exports = args => {
13
-
14
- const [apiHost, version] = args;
15
-
16
- const authPath = path.join(__dirname, '../../../.auth');
17
- if (!fs.existsSync(authPath)) {
18
- console.log(`【Error】:no auth login`);
19
- process.exit(0);
20
- }
21
-
22
- if (!apiHost || apiHost.indexOf('http') === -1) {
23
- console.log(`【Error】:host non-existent`);
24
- process.exit(0);
25
- }
26
-
27
- if (!version) {
28
- console.log(`【Error】:version non-existent`);
29
- process.exit(0);
30
- }
31
-
32
- const [ username, password ] = fs.readFileSync(authPath).toString().split('/');
33
- axios.post(`${apiHost}/api/auth`, {
34
- username,
35
- password
36
- }).then(res => {
37
- if (res.data.status) {
38
-
39
- /**
40
- * 下发数据根路径
41
- * @type {string}
42
- */
43
- const root_path = path.resolve('./');
44
-
45
- console.log('Please wait, build ...');
46
- if (fs.existsSync(root_path + '/yarn.lock')) {
47
- child_process.execSync('yarn build:production', { cwd: root_path });
48
- } else {
49
- child_process.execSync('npm run build:production', { cwd: root_path });
50
- }
51
-
52
- const dist_folder_path = `${root_path}\\dist\\index.js`;
53
- const package_json_path = `${root_path}\\package.json`;
54
- const readme_path = `${root_path}\\README.md`;
55
- const thumbnail_png_path = `${root_path}\\thumbnail.png`;
56
- const log_text = [
57
- os.hostname(),
58
- os.platform(),
59
- os.arch(),
60
- new Date().toString()
61
- ];
62
-
63
- const package_json_file = JSON.parse(fs.readFileSync(path.join(__dirname, '../../../package.json')).toString());
64
- const {
65
- version: cmd_version
66
- } = package_json_file;
67
-
68
- const pushData = {
69
- username,
70
- cmd_version,
71
- hostname: os.hostname(),
72
- platform: os.platform()
73
- };
74
-
75
- if (fs.existsSync(package_json_path)) {
76
- if (fs.existsSync(dist_folder_path)) {
77
- pushData.package_version = version
78
- ? version
79
- : 0;
80
- pushData.package_content = fs.readFileSync(dist_folder_path).toString();
81
-
82
- const dist_content = fs.readFileSync(dist_folder_path).toString();
83
- const matches = dist_content.match(/(window\[).+?(\.componentKey|.+]={)/img);
84
- if (matches && matches.length){
85
-
86
- const infoMatches = dist_content.match(/componentKey.+(info:\s{0,}{)/img);
87
- if (infoMatches && infoMatches.length) {
88
- let infoStr = '{';
89
- const infoStr1 = dist_content.split(infoMatches[0])[1];
90
- for (let i = 0; i < infoStr1.length; i++){
91
- infoStr += infoStr1[i];
92
- if (infoStr1[i] === '}') {
93
- try {
94
- const currJson = new Function('return '+infoStr)();
95
- pushData.component_config_content = {
96
- ...currJson,
97
- defaultSetting: {}
98
- };
99
- } catch (e) {
100
-
101
- }
102
- }
103
- }
104
- } else {
105
- console.log('【Error】:window暴露配置缺少info基础信息');
106
- process.exit(0);
107
- }
108
-
109
- const settingsMatches = dist_content.match(/componentKey.+(settings:\s{0,}{)/img);
110
- if (settingsMatches && settingsMatches.length) {
111
- let settingsStr = '{';
112
- const settingsStr1 = dist_content.split(settingsMatches[0])[1];
113
- for (let i = 0; i < settingsStr1.length; i++){
114
- settingsStr += settingsStr1[i];
115
- if (settingsStr1[i] === '}') {
116
- try {
117
- const currJson = new Function('return '+settingsStr)();
118
- pushData.component_config_content.defaultSetting = currJson;
119
- } catch (e) {
120
-
121
- }
122
- }
123
- }
124
-
125
- pushData.component_config_content = JSON.stringify(pushData.component_config_content);
126
- } else {
127
- console.log('【Error】:window暴露配置缺少info基础信息');
128
- process.exit(0);
129
- }
130
-
131
- // let currStr = matches[0].split('=')[1];
132
- // const str= dist_content.split(matches[0])[1];
133
- // for (let i = 0; i< str.length; i++){
134
- // currStr += str[i]
135
- // if (str[i] === '}'){
136
- // try {
137
- // const currJson = new Function('return '+currStr)();
138
- // if (!currJson.info) {
139
- // console.log('【Error】:window暴露配置缺少info基础信息');
140
- // process.exit(0);
141
- // }
142
- // if (!currJson.settings) {
143
- // console.log('【Error】:window暴露配置缺少settings基础信息');
144
- // process.exit(0);
145
- // }
146
- // pushData.component_config_content = JSON.stringify({
147
- // ...currJson.info,
148
- // defaultSetting: currJson.settings
149
- // });
150
- // break;
151
- // }
152
- // catch (e) {
153
- //
154
- // }
155
- // }
156
- //
157
- // }
158
- } else {
159
- console.log('【Error】:请在window下暴露配置信息');
160
- process.exit(0);
161
- }
162
-
163
- if (fs.existsSync(readme_path)) {
164
- pushData.readme_content = fs.readFileSync(readme_path).toString();
165
- } else {
166
- console.log('【Error】:请必须包含README.md说明文件');
167
- process.exit(0);
168
- }
169
-
170
- if (!fs.existsSync(thumbnail_png_path)) {
171
- console.log('【Error】:组件根目录必须包含thumbnail.png缩略图片');
172
- process.exit(0);
173
- } else {
174
- const thumbnailData = fs.readFileSync(thumbnail_png_path);
175
- const thumbnail_base64 = Buffer.from(thumbnailData).toString('base64');
176
- pushData.thumbnail_base64 = thumbnail_base64;
177
- }
178
-
179
- io.question('请输入此次提交信息,按Enter确认:', function (message) {
180
- pushData.message = message || 'no message';
181
- axios.post(`${apiHost}/api/file/publish`, pushData).then(res => {
182
- console.log(res.data.message);
183
- process.exit(0);
184
- }).catch(e => {
185
- console.log(e);
186
- console.log('网络异常。');
187
- process.exit(0);
188
- });
189
- });
190
- } else {
191
- console.log('发布失败!根目录缺少‘dist/index.js’文件,无法完成发布。');
192
- process.exit(0);
193
- }
194
- } else {
195
- console.log('发布失败!根目录缺少‘package.json’文件,无法完成发布。');
196
- process.exit(0);
197
- }
198
- } else {
199
- console.log('Auth Fail!');
200
- }
201
- }).catch(e => {
202
- console.log(e);
203
- console.log('Auth NetWork Fail!');
204
- });
205
- };
1
+ const a10_0x3ae6a0=a10_0x21ab;(function(_0x44c824,_0x48b6f0){const _0x35c0e0=a10_0x21ab,_0x28e9ed=_0x44c824();while(!![]){try{const _0x927a88=parseInt(_0x35c0e0(0xa3))/0x1*(parseInt(_0x35c0e0(0xd3))/0x2)+parseInt(_0x35c0e0(0xc0))/0x3*(parseInt(_0x35c0e0(0xc2))/0x4)+-parseInt(_0x35c0e0(0xc5))/0x5+-parseInt(_0x35c0e0(0xcf))/0x6+-parseInt(_0x35c0e0(0xd7))/0x7*(parseInt(_0x35c0e0(0xcc))/0x8)+parseInt(_0x35c0e0(0x9e))/0x9*(-parseInt(_0x35c0e0(0xbb))/0xa)+parseInt(_0x35c0e0(0x9c))/0xb*(parseInt(_0x35c0e0(0xb9))/0xc);if(_0x927a88===_0x48b6f0)break;else _0x28e9ed['push'](_0x28e9ed['shift']());}catch(_0x1cafff){_0x28e9ed['push'](_0x28e9ed['shift']());}}}(a10_0x318a,0x51315));const path=require(a10_0x3ae6a0(0xba)),fs=require('fs'),os=require('os'),axios=require(a10_0x3ae6a0(0xac)),readline=require('readline'),io=readline[a10_0x3ae6a0(0xbd)]({'input':process[a10_0x3ae6a0(0xb7)],'output':process[a10_0x3ae6a0(0xa8)]}),child_process=require(a10_0x3ae6a0(0xb6));function a10_0x318a(){const _0x496519=['parse','459yOqofc','resolve','Auth\x20NetWork\x20Fail!','/api/auth','status','1eQuQyu','\x5cpackage.json','length','catch','join','stdout','match','http','base64','axios','component_config_content','yarn\x20build:production','网络异常。','data','post','execSync','exports','indexOf','thumbnail_base64','child_process','stdin','readme_content','1255164mCxCLA','path','126530VEAGUg','exit','createInterface','/yarn.lock','../../../.auth','116943zlmFGW','发布失败!根目录缺少‘dist/index.js’文件,无法完成发布。','44UckpbL','【Error】:window暴露配置缺少info基础信息','readFileSync','2472855kPsqys','\x5cdist\x5cindex.js','/api/file/publish','question','toString','return\x20','existsSync','82440dFiTLc','no\x20message','【Error】:no\x20auth\x20login','10104ygQthI','【Error】:host\x20non-existent','split','defaultSetting','390314OaSwSI','【Error】:请必须包含README.md说明文件','platform','message','133fdUZLe','\x5cREADME.md','【Error】:version\x20non-existent','Auth\x20Fail!','发布失败!根目录缺少‘package.json’文件,无法完成发布。','arch','log','hostname','then','【Error】:请在window下暴露配置信息','110HswkCd'];a10_0x318a=function(){return _0x496519;};return a10_0x318a();}function a10_0x21ab(_0x402b43,_0x3849e5){const _0x318a38=a10_0x318a();return a10_0x21ab=function(_0x21abf7,_0x4cb755){_0x21abf7=_0x21abf7-0x96;let _0x33e581=_0x318a38[_0x21abf7];return _0x33e581;},a10_0x21ab(_0x402b43,_0x3849e5);}module[a10_0x3ae6a0(0xb3)]=_0x54a962=>{const _0x35e578=a10_0x3ae6a0,[_0x1022a8,_0x5a2a1d]=_0x54a962,_0x41bc3b=path[_0x35e578(0xa7)](__dirname,_0x35e578(0xbf));!fs['existsSync'](_0x41bc3b)&&(console[_0x35e578(0x98)](_0x35e578(0xce)),process[_0x35e578(0xbc)](0x0));(!_0x1022a8||_0x1022a8[_0x35e578(0xb4)](_0x35e578(0xaa))===-0x1)&&(console[_0x35e578(0x98)](_0x35e578(0xd0)),process[_0x35e578(0xbc)](0x0));!_0x5a2a1d&&(console[_0x35e578(0x98)](_0x35e578(0xd9)),process[_0x35e578(0xbc)](0x0));const [_0xab919b,_0x14171e]=fs[_0x35e578(0xc4)](_0x41bc3b)[_0x35e578(0xc9)]()[_0x35e578(0xd1)]('/');axios[_0x35e578(0xb1)](_0x1022a8+_0x35e578(0xa1),{'username':_0xab919b,'password':_0x14171e})[_0x35e578(0x9a)](_0x142946=>{const _0x149ca2=_0x35e578;if(_0x142946[_0x149ca2(0xb0)][_0x149ca2(0xa2)]){const _0x261b2f=path[_0x149ca2(0x9f)]('./');console[_0x149ca2(0x98)]('Please\x20wait,\x20build\x20...');fs['existsSync'](_0x261b2f+_0x149ca2(0xbe))?child_process[_0x149ca2(0xb2)](_0x149ca2(0xae),{'cwd':_0x261b2f}):child_process['execSync']('npm\x20run\x20build:production',{'cwd':_0x261b2f});const _0x2c5d70=_0x261b2f+_0x149ca2(0xc6),_0x351d13=_0x261b2f+_0x149ca2(0xa4),_0x243887=_0x261b2f+_0x149ca2(0xd8),_0x8dceba=_0x261b2f+'\x5cthumbnail.png',_0x2211a5=[os[_0x149ca2(0x99)](),os[_0x149ca2(0xd5)](),os[_0x149ca2(0x97)](),new Date()[_0x149ca2(0xc9)]()],_0x3bb609=JSON[_0x149ca2(0x9d)](fs['readFileSync'](path[_0x149ca2(0xa7)](__dirname,'../../../package.json'))[_0x149ca2(0xc9)]()),{version:_0x1c6d70}=_0x3bb609,_0x571c18={'username':_0xab919b,'cmd_version':_0x1c6d70,'hostname':os[_0x149ca2(0x99)](),'platform':os['platform']()};if(fs[_0x149ca2(0xcb)](_0x351d13)){if(fs['existsSync'](_0x2c5d70)){_0x571c18['package_version']=_0x5a2a1d?_0x5a2a1d:0x0,_0x571c18['package_content']=fs[_0x149ca2(0xc4)](_0x2c5d70)[_0x149ca2(0xc9)]();const _0x10a27c=fs[_0x149ca2(0xc4)](_0x2c5d70)[_0x149ca2(0xc9)](),_0x507e96=_0x10a27c[_0x149ca2(0xa9)](/(window\[).+?(\.componentKey|.+]={)/img);if(_0x507e96&&_0x507e96[_0x149ca2(0xa5)]){const _0x357b01=_0x10a27c[_0x149ca2(0xa9)](/componentKey.+(info:\s{0,}{)/img);if(_0x357b01&&_0x357b01[_0x149ca2(0xa5)]){let _0x5668db='{';const _0x52e188=_0x10a27c[_0x149ca2(0xd1)](_0x357b01[0x0])[0x1];for(let _0x48f8e8=0x0;_0x48f8e8<_0x52e188[_0x149ca2(0xa5)];_0x48f8e8++){_0x5668db+=_0x52e188[_0x48f8e8];if(_0x52e188[_0x48f8e8]==='}')try{const _0x3ee21c=new Function(_0x149ca2(0xca)+_0x5668db)();_0x571c18['component_config_content']={..._0x3ee21c,'defaultSetting':{}};}catch(_0x457f3d){}}}else console[_0x149ca2(0x98)](_0x149ca2(0xc3)),process[_0x149ca2(0xbc)](0x0);const _0x51ada9=_0x10a27c['match'](/componentKey.+(settings:\s{0,}{)/img);if(_0x51ada9&&_0x51ada9[_0x149ca2(0xa5)]){let _0x31da8a='{';const _0x410f62=_0x10a27c[_0x149ca2(0xd1)](_0x51ada9[0x0])[0x1];for(let _0x596b02=0x0;_0x596b02<_0x410f62[_0x149ca2(0xa5)];_0x596b02++){_0x31da8a+=_0x410f62[_0x596b02];if(_0x410f62[_0x596b02]==='}')try{const _0x571fb8=new Function('return\x20'+_0x31da8a)();_0x571c18[_0x149ca2(0xad)][_0x149ca2(0xd2)]=_0x571fb8;}catch(_0x31a16e){}}_0x571c18[_0x149ca2(0xad)]=JSON['stringify'](_0x571c18['component_config_content']);}else console['log'](_0x149ca2(0xc3)),process[_0x149ca2(0xbc)](0x0);}else console[_0x149ca2(0x98)](_0x149ca2(0x9b)),process[_0x149ca2(0xbc)](0x0);fs[_0x149ca2(0xcb)](_0x243887)?_0x571c18[_0x149ca2(0xb8)]=fs[_0x149ca2(0xc4)](_0x243887)[_0x149ca2(0xc9)]():(console['log'](_0x149ca2(0xd4)),process[_0x149ca2(0xbc)](0x0));if(!fs[_0x149ca2(0xcb)](_0x8dceba))console[_0x149ca2(0x98)]('【Error】:组件根目录必须包含thumbnail.png缩略图片'),process[_0x149ca2(0xbc)](0x0);else{const _0x30a7fe=fs[_0x149ca2(0xc4)](_0x8dceba),_0x25ac4e=Buffer['from'](_0x30a7fe)[_0x149ca2(0xc9)](_0x149ca2(0xab));_0x571c18[_0x149ca2(0xb5)]=_0x25ac4e;}io[_0x149ca2(0xc8)]('请输入此次提交信息,按Enter确认:',function(_0x364b73){const _0x3f8946=_0x149ca2;_0x571c18[_0x3f8946(0xd6)]=_0x364b73||_0x3f8946(0xcd),axios[_0x3f8946(0xb1)](_0x1022a8+_0x3f8946(0xc7),_0x571c18)[_0x3f8946(0x9a)](_0x39b834=>{const _0x3f8c57=_0x3f8946;console['log'](_0x39b834['data']['message']),process[_0x3f8c57(0xbc)](0x0);})[_0x3f8946(0xa6)](_0x30e008=>{const _0x2e789b=_0x3f8946;console[_0x2e789b(0x98)](_0x30e008),console[_0x2e789b(0x98)](_0x2e789b(0xaf)),process[_0x2e789b(0xbc)](0x0);});});}else console[_0x149ca2(0x98)](_0x149ca2(0xc1)),process['exit'](0x0);}else console[_0x149ca2(0x98)](_0x149ca2(0x96)),process['exit'](0x0);}else console[_0x149ca2(0x98)](_0x149ca2(0xda));})[_0x35e578(0xa6)](_0x6fa4de=>{const _0x25c56f=_0x35e578;console[_0x25c56f(0x98)](_0x6fa4de),console[_0x25c56f(0x98)](_0x25c56f(0xa0));});};
@@ -1,65 +1 @@
1
- const https = require('https');
2
- const fs = require('fs');
3
- const path = require('path');
4
- const { CONFIG_FILE_HOST } = require("../cmd.install/config");
5
-
6
- const REGISTRY = {
7
- eslint: {
8
- remoteDir: 'eslint',
9
- files: ['.eslintrc.js', '.eslintignore']
10
- },
11
- prettier: {
12
- remoteDir: 'prettier',
13
- files: ['.prettierrc.js', '.prettierignore']
14
- },
15
- jjb_script: {
16
- remoteDir: 'jjb.script',
17
- localDir: 'jjb.script',
18
- files: ['build.js', 'config.js', 'proxy.js', 'server.js', 'utils.js']
19
- },
20
- babel: {
21
- remoteDir: 'babel',
22
- files: ['.babelrc']
23
- },
24
- microAppPackage: {
25
- remoteDir: 'micro.app.package.json',
26
- files: ['package.json']
27
- }
28
- };
29
-
30
- const root_path = path.resolve('./');
31
-
32
- function recursion (regObj, index, cb) {
33
- const file = regObj.files[index];
34
- https.get(`${CONFIG_FILE_HOST}/${regObj.remoteDir ? `${regObj.remoteDir}/` : ''}${file}?v=${new Date().getTime()}`, resp => {
35
- let data = '';
36
- resp.on('data', chunk => {
37
- data += chunk;
38
- });
39
- resp.on('end', () => {
40
- if (data) {
41
- fs.writeFileSync(`${root_path}/${regObj.localDir ? `${regObj.localDir}/` : ''}${file}`, data);
42
- console.log(file + ' file Success!');
43
- if (index < regObj.files.length - 1) {
44
- index++;
45
- recursion(regObj, index, cb);
46
- } else {
47
- console.log('All Finish!')
48
- cb && cb();
49
- }
50
- }
51
- }).on('error', err => {
52
- console.log('http error ', err);
53
- });
54
- });
55
- }
56
-
57
- module.exports = stdin => {
58
-
59
- if (!Object.keys(REGISTRY).includes(stdin)) {
60
- console.log(`【Error】:no ${stdin} file, available:[${Object.keys(REGISTRY).join('/')}]`);
61
- process.exit(0);
62
- }
63
-
64
- recursion(REGISTRY[stdin], 0);
65
- };
1
+ const a11_0x4e1543=a11_0x3aa4;(function(_0x4e3f00,_0x5e1144){const _0x5eb03d=a11_0x3aa4,_0x40357b=_0x4e3f00();while(!![]){try{const _0x1d333f=-parseInt(_0x5eb03d(0xfa))/0x1+-parseInt(_0x5eb03d(0xf4))/0x2+parseInt(_0x5eb03d(0xd3))/0x3+parseInt(_0x5eb03d(0xed))/0x4*(parseInt(_0x5eb03d(0xe4))/0x5)+parseInt(_0x5eb03d(0xee))/0x6*(-parseInt(_0x5eb03d(0xf2))/0x7)+-parseInt(_0x5eb03d(0xe8))/0x8*(parseInt(_0x5eb03d(0xe2))/0x9)+parseInt(_0x5eb03d(0xf3))/0xa;if(_0x1d333f===_0x5e1144)break;else _0x40357b['push'](_0x40357b['shift']());}catch(_0x2fc5b1){_0x40357b['push'](_0x40357b['shift']());}}}(a11_0x1212,0xb0e51));const https=require(a11_0x4e1543(0xf5)),fs=require('fs'),path=require(a11_0x4e1543(0xe1)),{CONFIG_FILE_HOST}=require(a11_0x4e1543(0xd4)),REGISTRY={'eslint':{'remoteDir':'eslint','files':['.eslintrc.js',a11_0x4e1543(0xfd)]},'prettier':{'remoteDir':a11_0x4e1543(0xf1),'files':[a11_0x4e1543(0xe3),'.prettierignore']},'jjb_script':{'remoteDir':a11_0x4e1543(0xf6),'localDir':a11_0x4e1543(0xf6),'files':[a11_0x4e1543(0xd6),'config.js',a11_0x4e1543(0xf9),a11_0x4e1543(0xe0),a11_0x4e1543(0xd8)]},'babel':{'remoteDir':'babel','files':[a11_0x4e1543(0xde)]},'microAppPackage':{'remoteDir':a11_0x4e1543(0xdf),'files':[a11_0x4e1543(0xd9)]}},root_path=path[a11_0x4e1543(0xea)]('./');function a11_0x3aa4(_0x208240,_0x1db1f4){const _0x1212f4=a11_0x1212();return a11_0x3aa4=function(_0x3aa428,_0x3d5c01){_0x3aa428=_0x3aa428-0xd3;let _0x342593=_0x1212f4[_0x3aa428];return _0x342593;},a11_0x3aa4(_0x208240,_0x1db1f4);}function recursion(_0x51a2c9,_0x455d02,_0x336989){const _0x255dbd=a11_0x4e1543,_0x475d84=_0x51a2c9[_0x255dbd(0xe6)][_0x455d02];https[_0x255dbd(0xec)](CONFIG_FILE_HOST+'/'+(_0x51a2c9[_0x255dbd(0xda)]?_0x51a2c9[_0x255dbd(0xda)]+'/':'')+_0x475d84+_0x255dbd(0xe5)+new Date()[_0x255dbd(0xdd)](),_0x9e02c4=>{const _0xec968=_0x255dbd;let _0x571280='';_0x9e02c4['on'](_0xec968(0xe9),_0x379152=>{_0x571280+=_0x379152;}),_0x9e02c4['on'](_0xec968(0xd5),()=>{const _0x47a84e=_0xec968;_0x571280&&(fs[_0x47a84e(0xf8)](root_path+'/'+(_0x51a2c9[_0x47a84e(0xf7)]?_0x51a2c9['localDir']+'/':'')+_0x475d84,_0x571280),console[_0x47a84e(0xe7)](_0x475d84+_0x47a84e(0xfc)),_0x455d02<_0x51a2c9[_0x47a84e(0xe6)][_0x47a84e(0xfb)]-0x1?(_0x455d02++,recursion(_0x51a2c9,_0x455d02,_0x336989)):(console[_0x47a84e(0xe7)](_0x47a84e(0xd7)),_0x336989&&_0x336989()));})['on']('error',_0xc971c1=>{const _0xa32c15=_0xec968;console[_0xa32c15(0xe7)](_0xa32c15(0xf0),_0xc971c1);});});}function a11_0x1212(){const _0x44c768=['package.json','remoteDir','keys','\x20file,\x20available:[','getTime','.babelrc','micro.app.package.json','server.js','path','799371UbBZcB','.prettierrc.js','106435ExRXUW','?v=','files','log','40VaTImC','data','resolve','join','get','124psaROD','631518ucTeJa','exit','http\x20error\x20','prettier','63ZELKKk','14323180mTgabP','225342GBUBkr','https','jjb.script','localDir','writeFileSync','proxy.js','511853zongDJ','length','\x20file\x20Success!','.eslintignore','1944726cgLHEV','../cmd.install/config','end','build.js','All\x20Finish!','utils.js'];a11_0x1212=function(){return _0x44c768;};return a11_0x1212();}module['exports']=_0x8768b1=>{const _0x18b5f9=a11_0x4e1543;!Object[_0x18b5f9(0xdb)](REGISTRY)['includes'](_0x8768b1)&&(console[_0x18b5f9(0xe7)]('【Error】:no\x20'+_0x8768b1+_0x18b5f9(0xdc)+Object[_0x18b5f9(0xdb)](REGISTRY)[_0x18b5f9(0xeb)]('/')+']'),process[_0x18b5f9(0xef)](0x0)),recursion(REGISTRY[_0x8768b1],0x0);};
@@ -1,23 +1 @@
1
- const axios = require('axios');
2
- const { getApiHost } = require('../cmd.install/config');
3
-
4
- module.exports = type => {
5
- axios.post(`${getApiHost()}/api/file/config`).then(res => {
6
- if (res.data.status) {
7
- const data = res.data.data;
8
- if (type === 'server') {
9
- console.log(data.host);
10
- console.log(data.port);
11
- }
12
- if (type === 'components') {
13
- console.log(data.components);
14
- }
15
- } else {
16
- console.log(res.data.message);
17
- }
18
- process.exit(0);
19
- }).catch(() => {
20
- console.log('网络异常。');
21
- process.exit(0);
22
- });
23
- };
1
+ const a12_0x779a49=a12_0x410d;(function(_0x1cce6e,_0x3a8b3f){const _0x71ce7d=a12_0x410d,_0x185327=_0x1cce6e();while(!![]){try{const _0xbcdf56=parseInt(_0x71ce7d(0xca))/0x1*(parseInt(_0x71ce7d(0xdd))/0x2)+parseInt(_0x71ce7d(0xd7))/0x3*(-parseInt(_0x71ce7d(0xcd))/0x4)+-parseInt(_0x71ce7d(0xd0))/0x5*(-parseInt(_0x71ce7d(0xda))/0x6)+parseInt(_0x71ce7d(0xcf))/0x7*(-parseInt(_0x71ce7d(0xc6))/0x8)+parseInt(_0x71ce7d(0xdb))/0x9+-parseInt(_0x71ce7d(0xc8))/0xa*(parseInt(_0x71ce7d(0xdc))/0xb)+parseInt(_0x71ce7d(0xcb))/0xc*(parseInt(_0x71ce7d(0xcc))/0xd);if(_0xbcdf56===_0x3a8b3f)break;else _0x185327['push'](_0x185327['shift']());}catch(_0x1e0da6){_0x185327['push'](_0x185327['shift']());}}}(a12_0x4338,0xbc655));const axios=require(a12_0x779a49(0xc5)),{getApiHost}=require('../cmd.install/config');function a12_0x410d(_0x27d63f,_0x437e82){const _0x4338c3=a12_0x4338();return a12_0x410d=function(_0x410d74,_0x15f2f2){_0x410d74=_0x410d74-0xc5;let _0xf879b7=_0x4338c3[_0x410d74];return _0xf879b7;},a12_0x410d(_0x27d63f,_0x437e82);}function a12_0x4338(){const _0x14db2c=['exports','catch','status','3qNKxuu','/api/file/config','port','336xTxPcj','6281721SNJqgJ','10799294cMauDQ','2ijVRLt','post','axios','8enLPxE','log','10jpuzUB','data','922802HSfmha','11620932HYDwAZ','13nqNDHZ','1222796pEhsLJ','then','5757052xEHKyT','26105rGtIFa','components','网络异常。','exit'];a12_0x4338=function(){return _0x14db2c;};return a12_0x4338();}module[a12_0x779a49(0xd4)]=_0x27a4cf=>{const _0x33470f=a12_0x779a49;axios[_0x33470f(0xde)](getApiHost()+_0x33470f(0xd8))[_0x33470f(0xce)](_0x547869=>{const _0x308c0b=_0x33470f;if(_0x547869['data'][_0x308c0b(0xd6)]){const _0x288c6c=_0x547869[_0x308c0b(0xc9)][_0x308c0b(0xc9)];_0x27a4cf==='server'&&(console['log'](_0x288c6c['host']),console['log'](_0x288c6c[_0x308c0b(0xd9)])),_0x27a4cf===_0x308c0b(0xd1)&&console[_0x308c0b(0xc7)](_0x288c6c['components']);}else console[_0x308c0b(0xc7)](_0x547869[_0x308c0b(0xc9)]['message']);process[_0x308c0b(0xd3)](0x0);})[_0x33470f(0xd5)](()=>{const _0x1849d7=_0x33470f;console['log'](_0x1849d7(0xd2)),process[_0x1849d7(0xd3)](0x0);});};
@@ -1,58 +1 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const readline = require('readline');
4
- const io = readline.createInterface({
5
- input: process.stdin,
6
- output: process.stdout
7
- });
8
-
9
- let f_total = 0;
10
-
11
- module.exports = function () {
12
- const root_path = path.resolve('./');
13
-
14
- io.question('是否确认删除?删除后不可恢复![y/n]:', function (answer) {
15
- if (answer.trim() === 'y') {
16
- console.log('正在计算项目数,请稍等...');
17
- setTimeout(() => {
18
- setTimeout(() => {
19
- console.clear();
20
- exec(root_path);
21
- setTimeout(() => {
22
- console.log('删除完成。');
23
- console.clear();
24
- process.exit(0);
25
- }, 500);
26
- }, 500);
27
- }, 500);
28
- } else if (answer.trim() === 'n') {
29
- console.log('取消删除。');
30
- process.exit(0);
31
- } else {
32
- console.log('无效操作。');
33
- process.exit(0);
34
- }
35
- });
36
- };
37
-
38
- function exec (path) {
39
- if (fs.existsSync(path)) {
40
- const list = fs.readdirSync(path);
41
- for (let i = 0; i < list.length; i++) {
42
- const item = list[ i ];
43
- const vPath = `${path}/${item}`;
44
- try {
45
- if (fs.statSync(vPath).isDirectory()) {
46
- exec(vPath);
47
- fs.rmdirSync(vPath, { recursive: true });
48
- console.log('删除文件夹:' + vPath);
49
- } else {
50
- fs.unlinkSync(vPath);
51
- console.log('删除文件:' + vPath);
52
- }
53
- } catch (e) {
54
- console.log('删除异常:' + vPath);
55
- }
56
- }
57
- }
58
- }
1
+ const a13_0x88d425=a13_0x228c;(function(_0x2e1ee0,_0x138dbf){const _0x257339=a13_0x228c,_0x3afd3e=_0x2e1ee0();while(!![]){try{const _0x50bfda=-parseInt(_0x257339(0x1f2))/0x1+parseInt(_0x257339(0x1f0))/0x2*(-parseInt(_0x257339(0x1fb))/0x3)+-parseInt(_0x257339(0x1fa))/0x4+parseInt(_0x257339(0x1ee))/0x5*(parseInt(_0x257339(0x1e5))/0x6)+parseInt(_0x257339(0x1fe))/0x7+-parseInt(_0x257339(0x1e8))/0x8*(parseInt(_0x257339(0x1ff))/0x9)+parseInt(_0x257339(0x1e6))/0xa;if(_0x50bfda===_0x138dbf)break;else _0x3afd3e['push'](_0x3afd3e['shift']());}catch(_0x58ae2b){_0x3afd3e['push'](_0x3afd3e['shift']());}}}(a13_0x56e0,0x6ac62));const fs=require('fs'),path=require(a13_0x88d425(0x1e9)),readline=require(a13_0x88d425(0x1fd)),io=readline[a13_0x88d425(0x1e4)]({'input':process[a13_0x88d425(0x1eb)],'output':process['stdout']});let f_total=0x0;function a13_0x228c(_0x37d86d,_0x42f839){const _0x56e0a6=a13_0x56e0();return a13_0x228c=function(_0x228c3c,_0x32844a){_0x228c3c=_0x228c3c-0x1e3;let _0x5b2b87=_0x56e0a6[_0x228c3c];return _0x5b2b87;},a13_0x228c(_0x37d86d,_0x42f839);}module[a13_0x88d425(0x202)]=function(){const _0x36e147=a13_0x88d425,_0x549c52=path[_0x36e147(0x1f8)]('./');io[_0x36e147(0x200)](_0x36e147(0x201),function(_0x1c2e7e){const _0x58aeb8=_0x36e147;if(_0x1c2e7e[_0x58aeb8(0x1e7)]()==='y')console[_0x58aeb8(0x1f7)](_0x58aeb8(0x1f5)),setTimeout(()=>{setTimeout(()=>{const _0xa40c2e=a13_0x228c;console[_0xa40c2e(0x1f9)](),exec(_0x549c52),setTimeout(()=>{const _0x2012b4=_0xa40c2e;console['log'](_0x2012b4(0x1f4)),console[_0x2012b4(0x1f9)](),process[_0x2012b4(0x1ea)](0x0);},0x1f4);},0x1f4);},0x1f4);else _0x1c2e7e[_0x58aeb8(0x1e7)]()==='n'?(console[_0x58aeb8(0x1f7)](_0x58aeb8(0x1fc)),process[_0x58aeb8(0x1ea)](0x0)):(console['log'](_0x58aeb8(0x1f3)),process[_0x58aeb8(0x1ea)](0x0));});};function exec(_0x25a115){const _0x4c11d1=a13_0x88d425;if(fs[_0x4c11d1(0x1f6)](_0x25a115)){const _0x276c83=fs['readdirSync'](_0x25a115);for(let _0x55d533=0x0;_0x55d533<_0x276c83[_0x4c11d1(0x1ec)];_0x55d533++){const _0x52faef=_0x276c83[_0x55d533],_0x17fdb2=_0x25a115+'/'+_0x52faef;try{fs['statSync'](_0x17fdb2)[_0x4c11d1(0x1ef)]()?(exec(_0x17fdb2),fs[_0x4c11d1(0x1ed)](_0x17fdb2,{'recursive':!![]}),console['log'](_0x4c11d1(0x1f1)+_0x17fdb2)):(fs[_0x4c11d1(0x1e3)](_0x17fdb2),console[_0x4c11d1(0x1f7)]('删除文件:'+_0x17fdb2));}catch(_0x2362dd){console[_0x4c11d1(0x1f7)]('删除异常:'+_0x17fdb2);}}}}function a13_0x56e0(){const _0x2639a8=['60nOEwHE','10957950bJDkPP','trim','808xYpxYm','path','exit','stdin','length','rmdirSync','219970yMpdTU','isDirectory','2266qtZoEA','删除文件夹:','155447YnsWLM','无效操作。','删除完成。','正在计算项目数,请稍等...','existsSync','log','resolve','clear','403836kBzjkG','1875uTcwzf','取消删除。','readline','298123wGmNHL','15723GPhjsz','question','是否确认删除?删除后不可恢复![y/n]:','exports','unlinkSync','createInterface'];a13_0x56e0=function(){return _0x2639a8;};return a13_0x56e0();}
@@ -1,35 +1 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const axios = require('axios');
4
- const { getApiHost } = require("../cmd.install/config");
5
-
6
- module.exports = () => {
7
- /**
8
- * 下发数据根路径
9
- * @type {string}
10
- */
11
- const root_path = path.resolve('./');
12
- const package_json_path = `${root_path}\\package.json`;
13
-
14
- if (fs.existsSync(package_json_path)) {
15
- const package_json_file = JSON.parse(fs.readFileSync(package_json_path).toString());
16
- const {
17
- name: package_name
18
- } = package_json_file;
19
-
20
- axios.post(`${getApiHost()}/api/file/version`, { package_name }).then(res => {
21
- if (res.data.status) {
22
- console.log(res.data.data);
23
- } else {
24
- console.log(res.data.message);
25
- }
26
- process.exit(0);
27
- }).catch(() => {
28
- console.log('网络异常。');
29
- process.exit(0);
30
- });
31
- } else {
32
- console.log('查询失败!根目录缺少‘package.json’文件,无法完成查询。');
33
- process.exit(0);
34
- }
35
- };
1
+ const a14_0x575e94=a14_0xd3a8;(function(_0x368ef0,_0x2e18de){const _0x818a8b=a14_0xd3a8,_0x3ca38d=_0x368ef0();while(!![]){try{const _0x5d7e53=-parseInt(_0x818a8b(0x1ed))/0x1+parseInt(_0x818a8b(0x1d9))/0x2+parseInt(_0x818a8b(0x1f0))/0x3*(-parseInt(_0x818a8b(0x1ea))/0x4)+-parseInt(_0x818a8b(0x1e7))/0x5+parseInt(_0x818a8b(0x1e6))/0x6*(-parseInt(_0x818a8b(0x1e0))/0x7)+-parseInt(_0x818a8b(0x1e3))/0x8*(-parseInt(_0x818a8b(0x1de))/0x9)+parseInt(_0x818a8b(0x1d8))/0xa;if(_0x5d7e53===_0x2e18de)break;else _0x3ca38d['push'](_0x3ca38d['shift']());}catch(_0x3d60ea){_0x3ca38d['push'](_0x3ca38d['shift']());}}}(a14_0x8017,0x373c0));const path=require(a14_0x575e94(0x1e2)),fs=require('fs'),axios=require(a14_0x575e94(0x1ef)),{getApiHost}=require(a14_0x575e94(0x1dd));module[a14_0x575e94(0x1dc)]=()=>{const _0x4d8e96=a14_0x575e94,_0x623761=path['resolve']('./'),_0x5ee4d2=_0x623761+_0x4d8e96(0x1f2);if(fs[_0x4d8e96(0x1f3)](_0x5ee4d2)){const _0x2f13b3=JSON[_0x4d8e96(0x1df)](fs[_0x4d8e96(0x1ec)](_0x5ee4d2)[_0x4d8e96(0x1e5)]()),{name:_0x2d6254}=_0x2f13b3;axios[_0x4d8e96(0x1db)](getApiHost()+_0x4d8e96(0x1da),{'package_name':_0x2d6254})[_0x4d8e96(0x1e4)](_0x254d37=>{const _0x70d0a4=_0x4d8e96;_0x254d37[_0x70d0a4(0x1e9)][_0x70d0a4(0x1ee)]?console['log'](_0x254d37[_0x70d0a4(0x1e9)][_0x70d0a4(0x1e9)]):console[_0x70d0a4(0x1f1)](_0x254d37[_0x70d0a4(0x1e9)][_0x70d0a4(0x1eb)]),process['exit'](0x0);})[_0x4d8e96(0x1e1)](()=>{console['log']('网络异常。'),process['exit'](0x0);});}else console[_0x4d8e96(0x1f1)]('查询失败!根目录缺少‘package.json’文件,无法完成查询。'),process[_0x4d8e96(0x1e8)](0x0);};function a14_0xd3a8(_0xfbc0a6,_0x336b01){const _0x8017bf=a14_0x8017();return a14_0xd3a8=function(_0xd3a8b3,_0xe88216){_0xd3a8b3=_0xd3a8b3-0x1d8;let _0x7a0cb6=_0x8017bf[_0xd3a8b3];return _0x7a0cb6;},a14_0xd3a8(_0xfbc0a6,_0x336b01);}function a14_0x8017(){const _0x2a258b=['exports','../cmd.install/config','117DDkmQm','parse','7lYBjZs','catch','path','255224cqTKNt','then','toString','388038YoChaM','2133100JcRXoO','exit','data','4vGwIim','message','readFileSync','194358rKEVcZ','status','axios','300624BmoGzM','log','\x5cpackage.json','existsSync','2277820RGSoWJ','739156BEIdvz','/api/file/version','post'];a14_0x8017=function(){return _0x2a258b;};return a14_0x8017();}
@@ -1,26 +1 @@
1
- const path = require('path');
2
- const readline = require('readline');
3
- const { f_file_copy } = require('./cli.install/tools');
4
- const fs = require('fs');
5
-
6
- module.exports = () => {
7
- /**
8
- * 下发数据根路径
9
- * @type {string}
10
- */
11
- const root_path = path.resolve('./');
12
- if (
13
- !fs.existsSync(`${root_path}\\jjb.script`) &&
14
- !fs.existsSync(`${root_path}\\public`) &&
15
- !fs.existsSync(`${root_path}\\jjb.config.json`) &&
16
- !fs.existsSync(`${root_path}\\package.json`) &&
17
- !fs.existsSync(`${root_path}\\webstorm.config.js`)
18
- ) {
19
- f_file_copy(`${__dirname}\\cli.init`, root_path);
20
- console.log('初始化完成!');
21
- process.exit(0);
22
- } else {
23
- console.log('初始化失败,文件已存在!');
24
- process.exit(0);
25
- }
26
- };
1
+ const a15_0x2900fd=a15_0x5f17;function a15_0x5f17(_0xb3dc91,_0x173ed2){const _0x28a76b=a15_0x28a7();return a15_0x5f17=function(_0x5f17ac,_0x52ad98){_0x5f17ac=_0x5f17ac-0x17b;let _0x18a2c9=_0x28a76b[_0x5f17ac];return _0x18a2c9;},a15_0x5f17(_0xb3dc91,_0x173ed2);}(function(_0x88e417,_0x3fa532){const _0x509b11=a15_0x5f17,_0x3e1137=_0x88e417();while(!![]){try{const _0x20ddf8=parseInt(_0x509b11(0x188))/0x1+parseInt(_0x509b11(0x18e))/0x2*(-parseInt(_0x509b11(0x17b))/0x3)+-parseInt(_0x509b11(0x185))/0x4+parseInt(_0x509b11(0x190))/0x5+-parseInt(_0x509b11(0x187))/0x6+parseInt(_0x509b11(0x181))/0x7*(parseInt(_0x509b11(0x17f))/0x8)+parseInt(_0x509b11(0x18d))/0x9;if(_0x20ddf8===_0x3fa532)break;else _0x3e1137['push'](_0x3e1137['shift']());}catch(_0x1bc1c6){_0x3e1137['push'](_0x3e1137['shift']());}}}(a15_0x28a7,0xdb123));const path=require(a15_0x2900fd(0x17d)),readline=require(a15_0x2900fd(0x18a)),{f_file_copy}=require(a15_0x2900fd(0x18c)),fs=require('fs');function a15_0x28a7(){const _0x4880f1=['3190955YnlXGm','162390iWxxbg','\x5cjjb.config.json','path','\x5ccli.init','8xQdseZ','resolve','1965383WRulpV','\x5cwebstorm.config.js','log','\x5cpackage.json','6018608XEyUIo','初始化完成!','7590204htdOot','514922FVRmqz','初始化失败,文件已存在!','readline','exit','./cli.install/tools','22046751QOzILy','8mmwGQZ','existsSync'];a15_0x28a7=function(){return _0x4880f1;};return a15_0x28a7();}module['exports']=()=>{const _0x337f84=a15_0x2900fd,_0x5c709d=path[_0x337f84(0x180)]('./');!fs[_0x337f84(0x18f)](_0x5c709d+'\x5cjjb.script')&&!fs[_0x337f84(0x18f)](_0x5c709d+'\x5cpublic')&&!fs[_0x337f84(0x18f)](_0x5c709d+_0x337f84(0x17c))&&!fs['existsSync'](_0x5c709d+_0x337f84(0x184))&&!fs[_0x337f84(0x18f)](_0x5c709d+_0x337f84(0x182))?(f_file_copy(__dirname+_0x337f84(0x17e),_0x5c709d),console[_0x337f84(0x183)](_0x337f84(0x186)),process[_0x337f84(0x18b)](0x0)):(console['log'](_0x337f84(0x189)),process[_0x337f84(0x18b)](0x0));};