thinkncollab-cli 0.0.63 → 0.0.65

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/bin/index.js CHANGED
@@ -314,7 +314,7 @@ async function uploadTree(fileTree, folderHex, roomId, token, email, previousVer
314
314
  }
315
315
 
316
316
  /** ------------------ PUSH FUNCTION ------------------ **/
317
- async function push(roomId, targetPath) {
317
+ async function push(roomId, targetPath, pushBranch) {
318
318
  const { token, email } = readToken();
319
319
  const tncMetaPath = path.join(process.cwd(), ".tnc", ".tncmeta.json");
320
320
  if (!fs.existsSync(tncMetaPath)) {
@@ -370,7 +370,7 @@ async function push(roomId, targetPath) {
370
370
  console.log("🗂️ Sending metadata...");
371
371
  const res = await axios.post(
372
372
  `${BASE_URL}/${roomId}/upload`,
373
- { folderId: folderHex, content: uploadedTree, uploadedBy: email, projectId },
373
+ { folderId: folderHex, content: uploadedTree, uploadedBy: email, projectId , pushBranch},
374
374
  { headers: { authorization: `Bearer ${token}`, email } }
375
375
  );
376
376
 
@@ -435,14 +435,15 @@ async function main() {
435
435
  break;
436
436
 
437
437
  case "push": {
438
- const roomIndex = args.indexOf("--room");
439
- if (roomIndex === -1 || !args[roomIndex + 1] || !args[roomIndex + 2]) {
438
+ const roomIndex = args.indexOf("push");
439
+ if (roomIndex === -1 || !args[roomIndex + 2] || !args[roomIndex + 2]) {
440
440
  console.error("Usage: tnc push --room <roomId> <file-or-folder-path>");
441
441
  process.exit(1);
442
442
  }
443
- const roomId = args[roomIndex + 1];
444
- const targetPath = args[roomIndex + 2];
445
- await push(roomId, targetPath);
443
+ const roomId = args[roomIndex + 2];
444
+ const branch = args[roomIndex+1];
445
+ const targetPath = args[roomIndex + 3];
446
+ await push(roomId, targetPath, branch);
446
447
  break;
447
448
  }
448
449
  case "status":
@@ -72,7 +72,7 @@ async function createBranch(roomId) {
72
72
  throw new Error("User email not found in configuration. Please login again.");
73
73
  }
74
74
 
75
- const res = await axios.post("https://thinkncollab.in/cli/createBranch", {
75
+ const res = await axios.post("http://localhost:3001/cli/createBranch", {
76
76
  branchName: branchName.trim(),
77
77
  roomId,
78
78
  email,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thinkncollab-cli",
3
3
  "author": "Raman Singh",
4
- "version": "0.0.63",
4
+ "version": "0.0.65",
5
5
  "description": "CLI tool for ThinkNCollab",
6
6
  "main": "index.js",
7
7
  "bin": {