thinkncollab-cli 0.0.16 → 0.0.17
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/.ignoretnc +1 -1
- package/bin/index.js +10 -1
- package/package.json +1 -1
package/.ignoretnc
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/node_modules
|
|
2
|
-
|
|
2
|
+
.vscode
|
package/bin/index.js
CHANGED
|
@@ -13,6 +13,15 @@ const VERSION_FILE = path.join(process.cwd(), ".tncversions");
|
|
|
13
13
|
const BASE_URL = "http://localhost:3001/rooms";
|
|
14
14
|
const CWD = process.cwd();
|
|
15
15
|
|
|
16
|
+
|
|
17
|
+
const tncMetaPath = path.join(process.cwd(), ".tnc", ".tncmeta.json");
|
|
18
|
+
if (!fs.existsSync(tncMetaPath)) {
|
|
19
|
+
console.error("❌ Project not initialized. Run 'tnc init' first.");
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const meta = JSON.parse(fs.readFileSync(tncMetaPath, "utf-8"));
|
|
23
|
+
const projectId = meta.projectId;
|
|
24
|
+
|
|
16
25
|
/** ------------------ LOGIN ------------------ **/
|
|
17
26
|
async function login() {
|
|
18
27
|
const answers = await inquirer.prompt([
|
|
@@ -258,7 +267,7 @@ async function push(roomId, targetPath) {
|
|
|
258
267
|
console.log("🗂️ Sending metadata to backend...");
|
|
259
268
|
await axios.post(
|
|
260
269
|
`${BASE_URL}/${roomId}/upload`,
|
|
261
|
-
{ folderId: folderHex, content: uploadedTree, uploadedBy: email },
|
|
270
|
+
{ folderId: folderHex, content: uploadedTree, uploadedBy: email, projectId },
|
|
262
271
|
{ headers: { authorization: `Bearer ${token}`, email } }
|
|
263
272
|
);
|
|
264
273
|
|