Skip to content

Commit 4f697d5

Browse files
authored
Merge pull request #22 from leaperone/fix/issue-8-history-path
fix(history): use dirname() for correct config path calculation
2 parents f126dce + 7e50a19 commit 4f697d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/commands/history.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Command } from 'commander';
22
import chalk from 'chalk';
33
import { existsSync } from 'fs';
4-
import { join } from 'path';
4+
import { join, dirname } from 'path';
55
import { createDatabaseManagerFromConfigPath, EnvHistoryRecord } from '@/utils/db';
66

77
interface HistoryOptions {
@@ -30,7 +30,7 @@ export function historyCommand(program: Command): void {
3030
.action(async (tag: string | undefined, options: HistoryOptions) => {
3131
try {
3232
const configPath = join(process.cwd(), options.config || './envx.config.yaml');
33-
const configDir = join(process.cwd(), options.config || './envx.config.yaml', '..');
33+
const configDir = dirname(configPath);
3434

3535
console.log(chalk.blue('📚 Viewing environment variable history...'));
3636
console.log(chalk.gray(`📁 Config file: ${options.config}`));

0 commit comments

Comments
 (0)