Skip to content

Commit

Permalink
fix(repositories): prevent exiting script too early
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 22, 2021
1 parent c895757 commit aaeba18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions repositories/scripts/fetch-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const REPOSITORIES_RAW_CACHE = resolve(`${__dirname}/.repositories-raw-cache`);
const REPOSITORIES_PUBLIC_CACHE = resolve(
`${__dirname}/.repositories-public-cache`
);
const REPOSITORIES_JSON = resolve(`${__dirname}/../repositories.json`);
const REPOSITORIES_JSON = resolve(`${__dirname}/../src/repositories.json`);

const API_KEY = process.env.npm_config_libraries_io_api_key;
if (!API_KEY) {
Expand Down Expand Up @@ -129,7 +129,7 @@ const writeToArrayCache = <T>(location: string, results: T[]) => {
(item, index, array) => array.indexOf(item) === index
);

writeFileSync(location, JSON.stringify(newContent, null, 2), ENCODING);
writeFileSync(location, JSON.stringify(newContent, null, 4), ENCODING);
};

const generateDependentRepositoriesUrl = (project: string, page: number) => {
Expand All @@ -154,7 +154,7 @@ const main = async () => {

if (dependentRepositories.length === 0) {
console.log(chalk.green`Stopping at page ${page}`);
return process.exit();
break;
}

const repositories = dependentRepositories
Expand Down Expand Up @@ -188,4 +188,4 @@ const main = async () => {
);
};

main();
main().catch(console.error);

0 comments on commit aaeba18

Please sign in to comment.