mirror of
https://github.com/noothenoot/crafty-mod-installer.git
synced 2026-07-21 21:37:00 +00:00
Fix syntax error in index.js
This commit is contained in:
@@ -100,16 +100,16 @@ async function main() {
|
|||||||
|
|
||||||
// 5. Installation
|
// 5. Installation
|
||||||
console.log('🔄 Preparing installation...');
|
console.log('🔄 Preparing installation...');
|
||||||
|
|
||||||
// Determine final target directory
|
// Determine final target directory
|
||||||
let targetDir = '';
|
let targetDir = '';
|
||||||
if (isLocal) {
|
if (isLocal) {
|
||||||
const serverInfo = await crafty.getServerDetails(targetServerId);
|
const serverInfo = await crafty.getServerDetails(targetServerId);
|
||||||
// Crafty stores servers in folders named by their UUID or name
|
// Crafty stores servers in folders named by their UUID or name
|
||||||
// We assume the folder is in the base serverPath
|
// We assume the folder is in the base serverPath
|
||||||
targetDir = path.join(serverPath, serverInfo.server_id);
|
targetDir = path.join(serverPath, serverInfo.server_id);
|
||||||
// Note: Crafty 4 might use specific naming, we should verify info.path
|
// Note: Crafty 4 might use specific naming, we should verify info.path
|
||||||
if (serverInfo.path) targetDir = serverInfo.path;
|
if (serverInfo.path) targetDir = serverInfo.path;
|
||||||
} else {
|
} else {
|
||||||
targetDir = path.join(process.cwd(), 'temp_server_files');
|
targetDir = path.join(process.cwd(), 'temp_server_files');
|
||||||
await fs.ensureDir(targetDir);
|
await fs.ensureDir(targetDir);
|
||||||
@@ -146,3 +146,9 @@ async function main() {
|
|||||||
} else {
|
} else {
|
||||||
console.log(`✅ Success! Files installed to: ${targetDir}`);
|
console.log(`✅ Success! Files installed to: ${targetDir}`);
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('❌ Error:', err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
|||||||
Reference in New Issue
Block a user