@nexusbloom/cli 0.1.10 → 0.2.1
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/package.json +1 -1
- package/src/index.js +10 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -252,6 +252,15 @@ program
|
|
|
252
252
|
},
|
|
253
253
|
body: JSON.stringify(body),
|
|
254
254
|
});
|
|
255
|
+
|
|
256
|
+
if (!res.ok && !res.headers.get("content-type")?.includes("json")) {
|
|
257
|
+
const text = await res.text();
|
|
258
|
+
if (jsonMode) return console.log(JSON.stringify({ error: `API returned ${res.status}: ${text.slice(0, 200)}` }));
|
|
259
|
+
console.error(chalk.red(`API returned ${res.status} (non-JSON response). The endpoint may not be deployed.`));
|
|
260
|
+
console.error(chalk.dim(` Raw response: ${text.slice(0, 200)}`));
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
|
|
255
264
|
const data = await res.json();
|
|
256
265
|
if (data.success) {
|
|
257
266
|
if (jsonMode) return console.log(JSON.stringify({ success: true, data: data.data }, null, 2));
|
|
@@ -359,6 +368,7 @@ async function executeLocal(slug, input, jsonMode) {
|
|
|
359
368
|
if (manifest) {
|
|
360
369
|
fs.writeFileSync(cacheFile, JSON.stringify({ manifest, coreLogicSource, cachedAt: new Date().toISOString() }), "utf-8");
|
|
361
370
|
}
|
|
371
|
+
}
|
|
362
372
|
|
|
363
373
|
if (!coreLogicSource) {
|
|
364
374
|
// Fallback: try to extract coreLogic from the manifest itself
|