This commit is contained in:
25
src/index.ts
Normal file
25
src/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { Command } from 'commander';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.name('dotenv-types')
|
||||
.description('Validate .env files and generate TypeScript interfaces')
|
||||
.version(packageJson.version);
|
||||
|
||||
import { createValidateCommand } from './commands/validate';
|
||||
import { createGenerateCommand } from './commands/generate';
|
||||
import { createMigrateCommand } from './commands/migrate';
|
||||
|
||||
program.addCommand(createValidateCommand());
|
||||
program.addCommand(createGenerateCommand());
|
||||
program.addCommand(createMigrateCommand());
|
||||
|
||||
program.parse();
|
||||
Reference in New Issue
Block a user