hytopia 0.3.24 → 0.3.25
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/scripts.js +23 -0
- package/package.json +1 -1
package/bin/scripts.js
CHANGED
@@ -247,6 +247,29 @@ function initEditorMcp(editorName, editorFlag) {
|
|
247
247
|
function packageProject() {
|
248
248
|
const sourceDir = process.cwd();
|
249
249
|
const projectName = path.basename(sourceDir);
|
250
|
+
const packageJsonPath = path.join(sourceDir, 'package.json');
|
251
|
+
|
252
|
+
// Check if package.json exists
|
253
|
+
if (!fs.existsSync(packageJsonPath)) {
|
254
|
+
console.error('❌ Error: package.json not found. This directory does not appear to be a HYTOPIA project.');
|
255
|
+
console.error(' Please run this command in a valid HYTOPIA project directory.');
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
|
259
|
+
// Check if package.json contains "hytopia"
|
260
|
+
try {
|
261
|
+
const packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8');
|
262
|
+
if (!packageJsonContent.includes('hytopia')) {
|
263
|
+
console.error('❌ Error: This directory does not appear to be a HYTOPIA project.');
|
264
|
+
console.error(' The package.json file does not contain a reference to HYTOPIA.');
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
} catch (err) {
|
268
|
+
console.error('❌ Error: Could not read package.json file:', err.message);
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
|
272
|
+
// Prepare to package
|
250
273
|
const outputFile = path.join(sourceDir, `${projectName}.zip`);
|
251
274
|
|
252
275
|
console.log(`📦 Packaging project "${projectName}"...`);
|