UNPKG

@foxframework/core

Version:

A modern, production-ready web framework for TypeScript/Node.js with modular routing, integrated template engine, CLI tools, and enterprise features

23 lines (22 loc) 720 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.execAsync = void 0; exports.execCommand = execCommand; const child_process_1 = require("child_process"); const util_1 = require("util"); exports.execAsync = (0, util_1.promisify)(child_process_1.exec); /** * Execute command with better error handling */ async function execCommand(command, options) { try { const result = await (0, exports.execAsync)(command, { encoding: 'utf8', ...options }); return { stdout: result.stdout.toString(), stderr: result.stderr.toString() }; } catch (error) { throw new Error(`Command failed: ${command}\n${error.message}`); } }