Skip to content

Commit

Permalink
feat!: never create configuration files
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Previously a default configuration file was created
when given configuration file was not found. Removed configuration file
creation completely. It was completely useless.
  • Loading branch information
AriPerkkio committed Jun 12, 2022
1 parent 5b33d89 commit a26563b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 116 deletions.
97 changes: 0 additions & 97 deletions lib/config/config-templates.ts

This file was deleted.

19 changes: 0 additions & 19 deletions lib/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import chalk from 'chalk';
import { workerData, isMainThread } from 'worker_threads';

import { getConfigWithDefaults } from './validator';
import { CONFIGURATION_FILE_TEMPLATE } from './config-templates';
import { loadConfig } from './load';
import { WorkerData } from '@engine/types';

Expand Down Expand Up @@ -45,25 +44,7 @@ export function resolveConfigurationLocation(): string {
const CONFIGURATION_FILE = resolveConfigurationLocation();

if (!fs.existsSync(CONFIGURATION_FILE)) {
let defaultCreated = false;

if (CONFIGURATION_FILE === DEFAULT_CONFIGURATION_FILE_JS) {
fs.writeFileSync(
CONFIGURATION_FILE,
CONFIGURATION_FILE_TEMPLATE,
'utf8'
);
defaultCreated = true;
}

console.log(chalk.red(`Missing configuration file ${CONFIGURATION_FILE}.`));
if (defaultCreated) {
console.log(
chalk.green(
`Default configuration file created: ${DEFAULT_CONFIGURATION_FILE_JS}`
)
);
}
process.exit();
}

Expand Down

0 comments on commit a26563b

Please sign in to comment.