UNPKG

launch-express

Version:

CLI tool to setup a new Launch Express project

24 lines (23 loc) 868 B
import { exec } from 'child_process'; // Base64 encoded repository URLs const ENCODED_REPO = 'aHR0cHM6Ly9naXRodWIuY29tL0xhdW5jaC1FeHByZXNzL1N0YXJ0ZXItS2l0LmdpdA=='; function decodeUrl(encoded) { return Buffer.from(encoded, 'base64').toString('utf-8'); } export const execAsync = (command, options = {}) => { return new Promise((resolve, reject) => { const childProcess = exec(command, options, (error, stdout, stderr) => { if (error) { reject(error); return; } resolve({ stdout, stderr }); }); // If stdio is set to 'ignore', we handle it here if (options.stdio === 'ignore') { childProcess.stdout?.on('data', () => { }); childProcess.stderr?.on('data', () => { }); } }); }; export const REPO_URL = decodeUrl(ENCODED_REPO);