@compodoc/compodoc
Version:
The missing documentation tool for your Angular application
38 lines (30 loc) ⢠900 B
JavaScript
const { spawn } = require('child_process');
const path = require('path');
console.log('š Starting Template Playground...');
console.log('');
// Run the npm script
const npmProcess = spawn('npm', ['run', 'start-playground'], {
stdio: 'inherit',
shell: true,
cwd: path.join(__dirname, '..')
});
npmProcess.on('error', (error) => {
console.error('ā Failed to start Template Playground:', error.message);
process.exit(1);
});
npmProcess.on('close', (code) => {
if (code !== 0) {
console.error(`ā Template Playground exited with code ${code}`);
process.exit(code);
}
});
// Handle graceful shutdown
process.on('SIGINT', () => {
console.log('\nš Shutting down Template Playground...');
npmProcess.kill('SIGINT');
});
process.on('SIGTERM', () => {
console.log('\nš Shutting down Template Playground...');
npmProcess.kill('SIGTERM');
});