thinkncollab-cli 0.0.65 → 0.0.67
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/commands/branch.js +4 -3
- package/package.json +1 -1
package/commands/branch.js
CHANGED
|
@@ -4,8 +4,8 @@ import axios from "axios";
|
|
|
4
4
|
import os from "os";
|
|
5
5
|
import inquirer from "inquirer";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
async function updateBranch(branchName) {
|
|
7
|
+
|
|
8
|
+
async function updateBranch(branchName, branchId) {
|
|
9
9
|
const currentDir = process.cwd();
|
|
10
10
|
const tncFolder = path.join(currentDir, ".tnc");
|
|
11
11
|
const tncmetaFile = path.join(tncFolder, ".tncmeta.json");
|
|
@@ -30,6 +30,7 @@ async function updateBranch(branchName) {
|
|
|
30
30
|
|
|
31
31
|
// Update the current branch
|
|
32
32
|
meta.currentBranch = branchName;
|
|
33
|
+
Object.assign(meta, {branchId: `${branchId}`});
|
|
33
34
|
|
|
34
35
|
// Write updated data
|
|
35
36
|
fs.writeFileSync(tncmetaFile, JSON.stringify(meta, null, 2), "utf-8");
|
|
@@ -80,7 +81,7 @@ async function createBranch(roomId) {
|
|
|
80
81
|
|
|
81
82
|
if (res.data.success) {
|
|
82
83
|
console.log(`✅ Branch '${branchName}' created successfully!`);
|
|
83
|
-
await updateBranch(branchName);
|
|
84
|
+
await updateBranch(branchName, res.data.branch.id);
|
|
84
85
|
} else {
|
|
85
86
|
console.log(`❌ Failed to create branch: ${res.data.message}`);
|
|
86
87
|
}
|