yakuza0 2.23.5 → 2.23.6-beta.0

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/cli/index.js CHANGED
@@ -29,6 +29,10 @@ var _inclusive = require('../utils/inclusive.js');
29
29
 
30
30
  var _inclusive2 = _interopRequireDefault(_inclusive);
31
31
 
32
+ var _midfilter = require('../utils/midfilter.js');
33
+
34
+ var _midfilter2 = _interopRequireDefault(_midfilter);
35
+
32
36
  var _compress = require('../utils/compress.js');
33
37
 
34
38
  var _compress2 = _interopRequireDefault(_compress);
@@ -471,6 +475,10 @@ var run = exports.run = function () {
471
475
  execCmd(prefixCmd + ' YK0_server__yk4Addr=http://1.1.1.1 YK0_server__orbAddr=http://1.1.1.1 YK_ENV=' + CLNENV + ' YK_SERVER_ENV=' + CLNENV + ' YK_VERSIONSHA=' + CS + ' YK_DOCKERNAME=' + CS + ' YK_MACHINE_TYPE=workstation YK0_env=docker YK0_CONFIG_WORKERS=' + CLNWORKERS + ' npm run build');
472
476
  }
473
477
 
478
+ if (_os2.default.platform() === 'win32') {
479
+ (0, _midfilter2.default)(_paths2.default.ykServerPath);
480
+ }
481
+
474
482
  loop = function loop(i) {
475
483
  try {
476
484
  if (i < parseInt(TRY_TIMES)) {
@@ -486,10 +494,10 @@ var run = exports.run = function () {
486
494
 
487
495
  loop(0);
488
496
 
489
- _context6.next = 43;
497
+ _context6.next = 44;
490
498
  return (0, _server.delay)(1000);
491
499
 
492
- case 43:
500
+ case 44:
493
501
 
494
502
  if (CLNPACK && EXPORT) {
495
503
  if (!(0, _commandExists.sync)('gzip')) {
@@ -502,7 +510,7 @@ var run = exports.run = function () {
502
510
  _consola2.default.success('Image tar: ' + imageReleaseNameSave + '.tar');
503
511
  _consola2.default.success('Image name: ' + imageReleaseName);
504
512
 
505
- case 46:
513
+ case 47:
506
514
  case 'end':
507
515
  return _context6.stop();
508
516
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.5",
3
+ "version": "2.23.6-beta.0",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+
9
+ exports.default = function (targetDir) {
10
+ // const targetDir = '/Users/ningfujun/work/repo/web/CLN_BASE_TEST/.ykServer2'; // 替换为你的目标目录路径
11
+ var regex = /\['(.*?)'\]/g; // 用于匹配字符串的正则表达式
12
+
13
+ var files = fs.readdirSync(targetDir, { withFileTypes: true });
14
+
15
+ files.forEach(function (file) {
16
+ if (file.isDirectory()) {
17
+ var app = path.join(targetDir, file.name);
18
+ var mid = path.join(app, '.nuxt/middleware.js');
19
+ var content = fs.readFileSync(mid, 'utf-8');
20
+ // let match;
21
+ var match = regex.exec(content);
22
+ if (match) {
23
+ var fullPathString = match[1];
24
+
25
+ if (isWindowsPath(fullPathString)) {
26
+ var trimmedPath = fullPathString.split('/').slice(0, -1).join('/') + '/'; // 保留前面所有部分
27
+ traverseDirectorySync(app, new RegExp(trimmedPath, 'g'));
28
+ }
29
+ }
30
+ replaceInFileSync(mid, /\\\\/g, "/");
31
+ }
32
+ });
33
+
34
+ // 遍历目录并处理文件
35
+ function traverseDirectorySync(dir, targetString) {
36
+ var files = fs.readdirSync(dir);
37
+
38
+ files.forEach(function (file) {
39
+ var filePath = path.join(dir, file);
40
+ var stat = fs.statSync(filePath);
41
+
42
+ if (stat.isDirectory()) {
43
+ // 如果是目录,则递归遍历
44
+ traverseDirectorySync(filePath, targetString);
45
+ } else if (file.endsWith('.js')) {
46
+ // 如果是.js文件,则进行替换操作
47
+ replaceInFileSync(filePath, targetString);
48
+ }
49
+ });
50
+ }
51
+
52
+ // 替换文件内容中的字符串
53
+ function replaceInFileSync(filePath, targetReg, replaceString) {
54
+ try {
55
+ // 读取文件内容
56
+ var data = fs.readFileSync(filePath, 'utf8');
57
+
58
+ var result = data.replace(targetReg, replaceString || '');
59
+ // 写入文件
60
+ fs.writeFileSync(filePath, result, 'utf8');
61
+ // console.log(`已处理文件: ${filePath}`);
62
+ } catch (err) {
63
+ // console.error(`处理文件 ${filePath} 时出错: ${err}`);
64
+ }
65
+ }
66
+ function isWindowsPath(str) {
67
+ var windowsPathRegex = /^[a-zA-Z]:\\(?:[^<>:"/\\|?*\x00-\x1F]*\\)*[^<>:"/\\|?*\x00-\x1F]*$/;
68
+
69
+ return windowsPathRegex.test(str);
70
+ }
71
+ };
72
+
73
+ module.exports = exports['default'];