Skip to content

Commit

Permalink
feat: throw error if requested config file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Jan 6, 2025
1 parent d6e362a commit 9d4576c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cli/flowr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { repl, replProcessAnswer } from './repl/core';
import { printVersionInformation } from './repl/commands/repl-version';
import { printVersionRepl } from './repl/print-version';
import { defaultConfigFile, flowrMainOptionDefinitions, getScriptsText } from './flowr-main-options';
import fs from 'fs';

export const toolName = 'flowr';

Expand Down Expand Up @@ -87,6 +88,13 @@ if(options['config-json']) {
}
}
if(!usedConfig) {
if(options['config-file']) {
// validate it exists
if(!fs.existsSync(options['config-file'])) {
log.error(`Config file '${options['config-file']}' does not exist`);
process.exit(1);
}
}
setConfigFile(options['config-file'] ?? defaultConfigFile, undefined, true);
}

Expand Down

0 comments on commit 9d4576c

Please sign in to comment.