#!/usr/bin/env node

/**
 * GitDB Shell Global Executable
 * This file is the entry point when users run 'gitdb-shell' globally
 */

const path = require('path');
const { spawn } = require('child_process');

const shellPath = path.join(__dirname, '../dist/shell.js');
const child = spawn(process.execPath, [shellPath], { stdio: 'inherit' });
child.on('exit', code => process.exit(code));

process.on('SIGINT', () => {
  console.log('\nShutting down gitdb-shell...');
  process.exit(0);
});

process.on('SIGTERM', () => {
  console.log('\nShutting down gitdb-shell...');
  process.exit(0);
}); 