Skip to content

Commit

Permalink
chore: Minor refactor of getReadmeFile code
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed May 22, 2018
1 parent 0c48198 commit 2516504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/commands/readme.js
Expand Up @@ -13,12 +13,7 @@ const getReadmeFile = require('../get-readme-file');
module.exports.command = 'readme [input..]';
module.exports.description = 'inject documentation into your README.md';

let defaultReadmeFile = 'README.md';
try {
defaultReadmeFile = getReadmeFile('.');
} catch (err) {
// ignore and use default README.md
}
const defaultReadmeFile = getReadmeFile('.');

/**
* Add yargs parsing for the readme command
Expand Down
2 changes: 2 additions & 0 deletions src/get-readme-file.js
Expand Up @@ -22,4 +22,6 @@ module.exports = function findReadme(dir: string) {
if (readmeFile) {
return path.join(fs.realpathSync(dir), readmeFile);
}

return 'README.md';
};

0 comments on commit 2516504

Please sign in to comment.