cloudcc-cli 1.9.0 → 1.9.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/README.md CHANGED
@@ -1,3 +1,11 @@
1
+ # ReleaseV1.9.1
2
+ #### Release Date: 2025-2-10
3
+ #### Release Scope: Full
4
+ #### Release Content
5
+ * Optimization
6
+ * class add javaContentRegular
7
+ * change judge
8
+
1
9
  # ReleaseV1.9.0
2
10
  #### Release Date: 2025-2-10
3
11
  #### Release Scope: Full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -4,7 +4,7 @@ const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
6
 
7
- const { getBusToken } = require("../../utils/utils")
7
+ const { getBusToken, javaContentRegular } = require("../../utils/utils")
8
8
 
9
9
  async function publish(name) {
10
10
  let res = await checkUpdate();
@@ -15,7 +15,7 @@ async function publish(name) {
15
15
  const classPath = path.join(process.cwd(), `classes/${name}/`);
16
16
  let fullContent = fs.readFileSync(classPath + `${name}.java`, 'utf8');
17
17
 
18
- const sourceMatch = fullContent.match(/\/\/\s*@SOURCE_CONTENT_START\n([\s\S]*?)\n\/\/\s*@SOURCE_CONTENT_END/);
18
+ const sourceMatch = fullContent.match(javaContentRegular);
19
19
  let classContent = sourceMatch ? sourceMatch[1] : fullContent;
20
20
  let configContent = JSON.parse(fs.readFileSync(classPath + "config.json", 'utf8'));
21
21
 
@@ -4,7 +4,7 @@ const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
6
 
7
- const { getBusToken } = require("../../utils/utils")
7
+ const { getBusToken, javaContentRegular } = require("../../utils/utils")
8
8
 
9
9
  async function pull(name) {
10
10
  let res = await checkUpdate();
@@ -26,9 +26,9 @@ async function pull(name) {
26
26
  let fullContent = fs.readFileSync(classPath + `${name}.java`, 'utf8');
27
27
 
28
28
  let newContent = '';
29
- if (fullContent) {
29
+ if (fullContent.includes("@SOURCE_CONTENT_START")) {
30
30
  newContent = fullContent.replace(
31
- /\/\/ @SOURCE_CONTENT_START\n[\s\S]*?\n\/\/ @SOURCE_CONTENT_END/,
31
+ javaContentRegular,
32
32
  `// @SOURCE_CONTENT_START\n${res.data.trigger.source}\n// @SOURCE_CONTENT_END`
33
33
  );
34
34
  } else {
@@ -4,7 +4,7 @@ const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
6
 
7
- const { getBusToken } = require("../../utils/utils")
7
+ const { getBusToken, javaContentRegular } = require("../../utils/utils")
8
8
 
9
9
  async function publish(name) {
10
10
  let res = await checkUpdate();
@@ -15,7 +15,7 @@ async function publish(name) {
15
15
  const timerPath = path.join(process.cwd(), `schedule/${name}/`);
16
16
  let fullContent = fs.readFileSync(timerPath + `${name}.java`, 'utf8');
17
17
 
18
- const sourceMatch = fullContent.match(/\/\/\s*@SOURCE_CONTENT_START([\s\S]*?)\/\/\s*@SOURCE_CONTENT_END/);
18
+ const sourceMatch = fullContent.match(javaContentRegular);
19
19
  let classContent = sourceMatch ? sourceMatch[1] : fullContent;
20
20
 
21
21
  let configContent = JSON.parse(fs.readFileSync(timerPath + "config.json", 'utf8'));
package/src/timer/pull.js CHANGED
@@ -4,7 +4,7 @@ const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
6
 
7
- const { getBusToken } = require("../../utils/utils")
7
+ const { getBusToken, javaContentRegular } = require("../../utils/utils")
8
8
 
9
9
  async function pull(name) {
10
10
  let res = await checkUpdate();
@@ -28,9 +28,9 @@ async function pull(name) {
28
28
  let fullContent = fs.readFileSync(timerPath + `${name}.java`, 'utf8');
29
29
 
30
30
  let newContent = '';
31
- if (fullContent) {
31
+ if (fullContent.includes("@SOURCE_CONTENT_START")) {
32
32
  newContent = fullContent.replace(
33
- /\/\/\s*@SOURCE_CONTENT_START[\s\S]*?\/\/\s*@SOURCE_CONTENT_END/,
33
+ javaContentRegular,
34
34
  `// @SOURCE_CONTENT_START\n${res.data.trigger.source}\n// @SOURCE_CONTENT_END`
35
35
  );
36
36
  } else {
@@ -3,7 +3,7 @@ const fs = require("fs");
3
3
  const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
- const { getBusToken } = require("../../utils/utils")
6
+ const { getBusToken ,javaContentRegular} = require("../../utils/utils")
7
7
 
8
8
  async function publish(argvs) {
9
9
  let namePath = argvs[2]
@@ -16,7 +16,7 @@ async function publish(argvs) {
16
16
  const triggersPath = path.join(process.cwd(), `triggers/${namePath}/`);
17
17
  let fullContent = fs.readFileSync(triggersPath + `${name}.java`, 'utf8');
18
18
 
19
- const sourceMatch = fullContent.match(/\/\/\s*@SOURCE_CONTENT_START([\s\S]*?)\/\/\s*@SOURCE_CONTENT_END/);
19
+ const sourceMatch = fullContent.match(javaContentRegular);
20
20
  let triggersContent = sourceMatch ? sourceMatch[1] : fullContent;
21
21
  let configContent = JSON.parse(fs.readFileSync(triggersPath + "config.json", 'utf8'));
22
22
 
@@ -3,7 +3,7 @@ const fs = require("fs");
3
3
  const path = require("path")
4
4
  const chalk = require("chalk")
5
5
  const { postNormal } = require("../../utils/http")
6
- const { getBusToken } = require("../../utils/utils")
6
+ const { getBusToken, javaContentRegular } = require("../../utils/utils")
7
7
 
8
8
  async function pull(argvs) {
9
9
  let namePath = argvs[2]
@@ -27,10 +27,9 @@ async function pull(argvs) {
27
27
 
28
28
  let fullContent = fs.readFileSync(triggersPath + `${name}.java`, 'utf8');
29
29
  let newContent = '';
30
-
31
- if (fullContent) {
30
+ if (fullContent.includes("@SOURCE_CONTENT_START")) {
32
31
  newContent = fullContent.replace(
33
- /\/\/\s*@SOURCE_CONTENT_START([\s\S]*?)\/\/\s*@SOURCE_CONTENT_END/,
32
+ javaContentRegular,
34
33
  `// @SOURCE_CONTENT_START\n${res.data.trigger.triggerSource}\n// @SOURCE_CONTENT_END`
35
34
  );
36
35
  } else {
package/utils/utils.js CHANGED
@@ -92,5 +92,6 @@ async function getBusToken(path = process.cwd()) {
92
92
  }
93
93
  return false;
94
94
  }
95
+ const javaContentRegular = /\/\/\s*@SOURCE_CONTENT_START\n([\s\S]*?)\n\/\/\s*@SOURCE_CONTENT_END/
95
96
 
96
- module.exports = { getBusToken }
97
+ module.exports = { getBusToken, javaContentRegular }