coursecode 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/lib/cloud.js +8 -1
  2. package/package.json +1 -1
package/lib/cloud.js CHANGED
@@ -319,13 +319,20 @@ async function runLoginFlow() {
319
319
  }
320
320
 
321
321
  /**
322
- * Ensure the user is authenticated. Auto-triggers login if no credentials.
322
+ * Ensure the user is authenticated. Auto-triggers login if interactive.
323
+ * In non-interactive environments, exits with an error message.
323
324
  * @returns {Promise<string>} The API token
324
325
  */
325
326
  export async function ensureAuthenticated() {
326
327
  const creds = readCredentials();
327
328
  if (creds?.token) return creds.token;
328
329
 
330
+ // Non-interactive: can't launch browser login — exit with clear error
331
+ if (!process.stdin.isTTY) {
332
+ console.error('\n❌ No Cloud credentials found. Run `coursecode login` first.\n');
333
+ process.exit(1);
334
+ }
335
+
329
336
  console.log('\n No Cloud credentials found. Launching login...');
330
337
  return runLoginFlow();
331
338
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coursecode",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Multi-format course authoring framework with CLI tools (SCORM 2004, SCORM 1.2, cmi5, LTI 1.3)",
5
5
  "type": "module",
6
6
  "bin": {