Skip to content

Commit

Permalink
Refactor to use switch
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 5, 2019
1 parent 8bd9ef4 commit de05b4b
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions bin/update-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ const packages = [
];

const getArgsForPackage = ( packageName ) => {
const defaultArgs = [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
];

const argsForPackage = {
'rich-text': [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "^unstable|^apply$|^changeListType$"',
],
};

return argsForPackage[ packageName ] || defaultArgs;
switch ( packageName ) {
case 'rich-text':
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "^unstable|^apply$|^changeListType$"',
];
default:
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
];
}
};

let aggregatedExitCode = 0;
Expand Down

0 comments on commit de05b4b

Please sign in to comment.