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 +8 -7
- package/commands/branch.js +1 -1
- package/package.json +1 -1
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("
|
|
439
|
-
if (roomIndex === -1 || !args[roomIndex +
|
|
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 +
|
|
444
|
-
const
|
|
445
|
-
|
|
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":
|
package/commands/branch.js
CHANGED
|
@@ -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("
|
|
75
|
+
const res = await axios.post("http://localhost:3001/cli/createBranch", {
|
|
76
76
|
branchName: branchName.trim(),
|
|
77
77
|
roomId,
|
|
78
78
|
email,
|