File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ export const API_SUB_CATEGORIES = {
1010 'in-app-messaging' : 'in-app-messaging'
1111} ;
1212
13- export const ROOT_PACKAGE = 'amplify-js ' ;
13+ export const ROOT_PACKAGE = 'aws-amplify ' ;
Original file line number Diff line number Diff line change @@ -15,21 +15,25 @@ import {
1515/**
1616 * Read the -p flag from the cli params
1717 *
18- * This flag tells is which package is adjacent with a references file to read from
18+ * This flag tells us the next arg is the name of a package with a references file to read from
1919 * eg. `-p amplify-js` means that `../amplify-js/docs/reference.json` exists and is
2020 * ready to be transformed into `src/directory/apiReferences/amplify-js.json`
2121 */
2222const packageIndex = process . argv . indexOf ( '-p' ) ;
2323
2424if ( packageIndex === - 1 ) {
25- throw new Error (
26- 'No package name provided please provide a package name in -p.'
27- ) ;
25+ throw new Error ( 'No package name provided with -p.' ) ;
2826}
2927
3028const packageName = process . argv [ packageIndex + 1 ] ;
3129
32- const referencesFile = readFileSync ( `../${ packageName } /docs/reference.json` ) ;
30+ let referencesFile ;
31+
32+ try {
33+ referencesFile = readFileSync ( `../${ packageName } /docs/reference.json` ) ;
34+ } catch ( e ) {
35+ throw new Error ( `No references file found for ${ packageName } ` ) ;
36+ }
3337
3438const references = processReferences ( JSON . parse ( referencesFile ) , ROOT_PACKAGE ) ;
3539const cleanReferences = { } ;
You can’t perform that action at this time.
0 commit comments