Skip to content

Commit 3be1a7f

Browse files
committed
PR comment fixes
1 parent 99269a1 commit 3be1a7f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/data/api-categories.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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';

tasks/clean-references.mjs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff 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
*/
2222
const packageIndex = process.argv.indexOf('-p');
2323

2424
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.');
2826
}
2927

3028
const 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

3438
const references = processReferences(JSON.parse(referencesFile), ROOT_PACKAGE);
3539
const cleanReferences = {};

0 commit comments

Comments
 (0)