cloudcc-cli 1.8.3 → 1.8.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.
- package/README.md +7 -0
- package/package.json +1 -1
- package/src/triggers/create.js +2 -1
- package/src/triggers/publish.js +4 -4
package/README.md
CHANGED
package/package.json
CHANGED
package/src/triggers/create.js
CHANGED
|
@@ -8,8 +8,9 @@ async function create(argvs) {
|
|
|
8
8
|
let res = await checkUpdate();
|
|
9
9
|
if (!res) {
|
|
10
10
|
let body = JSON.parse(decodeURI(argvs[2]))
|
|
11
|
+
console.log(decodeURI(argvs[2]))
|
|
11
12
|
const baseTriggersPath = path.join(process.cwd(), "triggers");
|
|
12
|
-
const objectFolderPath = path.join(baseTriggersPath, `${body.schemetableName.toLowerCase()}
|
|
13
|
+
const objectFolderPath = path.join(baseTriggersPath, `${body.schemetableName.toLowerCase()}`, body.triggerTime);
|
|
13
14
|
const triggersPath = path.join(objectFolderPath, body.name);
|
|
14
15
|
|
|
15
16
|
try {
|
package/src/triggers/publish.js
CHANGED
|
@@ -7,20 +7,20 @@ const { getBusToken } = require("../../utils/utils")
|
|
|
7
7
|
|
|
8
8
|
async function publish(argvs) {
|
|
9
9
|
let namePath = argvs[2]
|
|
10
|
-
let name = namePath.
|
|
10
|
+
let name = path.basename(namePath, '.java')
|
|
11
|
+
let dirPath = path.dirname(namePath) // 获取不包含文件名的目录路径
|
|
11
12
|
let res = await checkUpdate();
|
|
12
13
|
if (!res) {
|
|
13
14
|
console.log();
|
|
14
15
|
console.log(chalk.green('Posting, please wait...'));
|
|
15
16
|
console.log();
|
|
16
|
-
|
|
17
|
-
let fullContent = fs.readFileSync(triggersPath + `${name}.java`, 'utf8');
|
|
17
|
+
let fullContent = fs.readFileSync(namePath, 'utf8');
|
|
18
18
|
|
|
19
19
|
// 提取标记之间的内容
|
|
20
20
|
const sourceMatch = fullContent.match(/\/\/ @SOURCE_CONTENT_START\n([\s\S]*?)\n\/\/ @SOURCE_CONTENT_END/);
|
|
21
21
|
let classContent = sourceMatch ? sourceMatch[1] : fullContent;
|
|
22
22
|
|
|
23
|
-
let configContent = JSON.parse(fs.readFileSync(
|
|
23
|
+
let configContent = JSON.parse(fs.readFileSync(path.join(dirPath, "config.json"), 'utf8'));
|
|
24
24
|
|
|
25
25
|
if (await getBusToken()) {
|
|
26
26
|
let body = {
|