@runreal/unreal-mcp
Version:
MCP server for Unreal Engine using Unreal Python Remote Execution
46 lines (45 loc) • 2.15 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_child_process_1 = require("node:child_process");
// https://github.com/modelcontextprotocol/inspector/blob/main/cli/scripts/make-executable.js
/**
* Cross-platform script to make a file executable
*/
const node_fs_1 = require("node:fs");
const node_os_1 = require("node:os");
const node_path_1 = __importDefault(require("node:path"));
const TARGET_FILE = node_path_1.default.resolve("dist/bin.js");
function makeExecutable() {
return __awaiter(this, void 0, void 0, function* () {
try {
// On Unix-like systems (Linux, macOS), use chmod
if ((0, node_os_1.platform)() !== "win32") {
(0, node_child_process_1.execSync)(`chmod +x "${TARGET_FILE}"`);
console.log("Made file executable with chmod");
}
else {
// On Windows, no need to make files "executable" in the Unix sense
// Just ensure the file exists
yield node_fs_1.promises.access(TARGET_FILE);
console.log("File exists and is accessible on Windows");
}
}
catch (error) {
console.error("Error making file executable:", error);
process.exit(1);
}
});
}
makeExecutable();