mirror of
https://github.com/aljazceru/dvmcp.git
synced 2025-12-17 21:34:24 +01:00
feat: working on distribution
This commit is contained in:
31
packages/dvmcp-bridge/cli.ts
Executable file
31
packages/dvmcp-bridge/cli.ts
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bun
|
||||
import { join, dirname } from 'node:path';
|
||||
import { existsSync, copyFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// Ensure we can run from any directory
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
process.chdir(__dirname);
|
||||
|
||||
// Check for config file
|
||||
const configPath = join(process.cwd(), 'config.yml');
|
||||
const configExamplePath = join(process.cwd(), 'config.example.yml');
|
||||
|
||||
if (!existsSync(configPath)) {
|
||||
console.log('Configuration file not found at config.yml');
|
||||
console.log('You can create one by copying the example:');
|
||||
console.log('cp config.example.yml config.yml');
|
||||
|
||||
// Automatically copy example config if it exists
|
||||
if (existsSync(configExamplePath)) {
|
||||
console.log('Creating config.yml from example...');
|
||||
copyFileSync(configExamplePath, configPath);
|
||||
console.log(
|
||||
'✅ Created config.yml - please edit this file with your settings!'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the application
|
||||
import './index.js';
|
||||
Reference in New Issue
Block a user