Skip to content

Commit

Permalink
gen-repo:
Browse files Browse the repository at this point in the history
- strip newlines from github description
- add try-catch for unhandled errors
  • Loading branch information
eddiechayes committed Mar 11, 2024
1 parent 66612ac commit 1cfd31a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sdks/scripts/generate-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ async function generateSdkRepositories(
const languages = ["typescript", "java", "python"];
const result: GenerateSdkResult[] = [];

languages.forEach((language) => {
console.log(`Generating ${language} SDK for ${key}...`);
result.push(generateSdkRepository(key, language, debug));
});
try {
languages.forEach((language) => {
console.log(`Generating ${language} SDK for ${key}...`);
result.push(generateSdkRepository(key, language, debug));
});
} catch (error) {
console.log(`Uncaught exception in ${key} generation: ${error}`);
}
return result;
}

Expand Down Expand Up @@ -279,6 +283,8 @@ function generateRepositoryDescription(data: Published, language: string) {
let companyDescription = data.metaDescription.trim();
if (!companyDescription.endsWith("."))
companyDescription = companyDescription + ".";
// strip illegal characters / character sequences
companyDescription = companyDescription.replace(/\n/g, " ");
const description = `${data.company}'s ${capitalizedLanguage[language]} SDK ${serviceNameSuffix}generated by Konfig (https://konfigthis.com/).`;
// github repo description limit is 350 characters
if (
Expand Down

0 comments on commit 1cfd31a

Please sign in to comment.