Skip to content

Commit

Permalink
Merge pull request #36 from fadingNA/issue-31-adding-handling-message
Browse files Browse the repository at this point in the history
Issue 31 adding handling message
  • Loading branch information
peterdanwan authored Oct 2, 2024
2 parents cf18191 + 39be881 commit bea2e81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/file_functions/getTOMLFileValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ const __homeDir = os.homedir();
export default function getTOMLFileValues() {
const tomlFile = path.join(__homeDir, '.gimme_readme_config');

if (!fs.existsSync(tomlFile)) {
return null;
}

try {
const configContent = fs.readFileSync(tomlFile, 'utf-8');
const tomlParser = parseTOML(configContent);
const config = getStaticTOMLValue(tomlParser);
return config;
} catch (err) {
} catch (error) {
console.error(
`Error at handleConfigOption when system is reading TOML at ${tomlFile} with error ${err}`
`Error parsing .gimme_readme_config. File is not formatted using TOML syntax: ${error}`
);
return null;
process.exit(1);
}
}
6 changes: 0 additions & 6 deletions src/option_handlers/handleConfigCase.js

This file was deleted.

0 comments on commit bea2e81

Please sign in to comment.