diff --git a/lib/github.ts b/lib/github.ts index f65555c0..050098ac 100644 --- a/lib/github.ts +++ b/lib/github.ts @@ -146,7 +146,11 @@ async function fetchGitHubRepoContentFromDownloadUrl( downloadUrl: string ): Promise { const resp = await fetchRepoFileByDownloadUrl(downloadUrl); - fs.writeFileSync(dest, resp.data, 'utf8'); + const fileContents = + typeof resp.data === 'string' + ? resp.data + : JSON.stringify(resp.data, null, 2); + fs.outputFileSync(dest, fileContents, 'utf8'); } // Writes files from a public repository to the destination folder diff --git a/types/Utils.ts b/types/Utils.ts index a83e4c18..64aac4b9 100644 --- a/types/Utils.ts +++ b/types/Utils.ts @@ -9,5 +9,5 @@ type Join = K extends string | number export type Leaves = [10] extends [never] ? never : T extends object - ? { [K in keyof T]-?: Join> }[keyof T] - : ''; + ? { [K in keyof T]-?: Join> }[keyof T] + : '';