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 = {
10
10
'in-app-messaging' : 'in-app-messaging'
11
11
} ;
12
12
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 {
15
15
/**
16
16
* Read the -p flag from the cli params
17
17
*
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
19
19
* eg. `-p amplify-js` means that `../amplify-js/docs/reference.json` exists and is
20
20
* ready to be transformed into `src/directory/apiReferences/amplify-js.json`
21
21
*/
22
22
const packageIndex = process . argv . indexOf ( '-p' ) ;
23
23
24
24
if ( 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.' ) ;
28
26
}
29
27
30
28
const packageName = process . argv [ packageIndex + 1 ] ;
31
29
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
+ }
33
37
34
38
const references = processReferences ( JSON . parse ( referencesFile ) , ROOT_PACKAGE ) ;
35
39
const cleanReferences = { } ;
You can’t perform that action at this time.
0 commit comments