Skip to content

Commit

Permalink
remove unnecessary indent change
Browse files Browse the repository at this point in the history
remove unnecessary indent change by auto lint
  • Loading branch information
aolyang committed Oct 20, 2023
1 parent dd4f67a commit 35ee674
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions packages/@contentlayer/core/src/generation/generate-dotpkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,33 +309,33 @@ const makePackageJson = (schemaHash: string): string => {
*/
const writeFileWithWrittenFilesCache =
({ writtenFilesCache }: { writtenFilesCache: WrittenFilesCache }) =>
({
filePath,
content,
documentHash,
rmBeforeWrite = true,
}: {
filePath: AbsolutePosixFilePath
content: string
documentHash?: string
/** In order for VSC to pick up changes in generated files, it's currently needed to delete the file before re-creating it */
rmBeforeWrite?: boolean
}) =>
T.gen(function* ($) {
// TODO also consider schema hash
const fileIsUpToDate = documentHash !== undefined && writtenFilesCache[filePath] === documentHash
if (!rmBeforeWrite && fileIsUpToDate) {
return
}
({
filePath,
content,
documentHash,
rmBeforeWrite = true,
}: {
filePath: AbsolutePosixFilePath
content: string
documentHash?: string
/** In order for VSC to pick up changes in generated files, it's currently needed to delete the file before re-creating it */
rmBeforeWrite?: boolean
}) =>
T.gen(function* ($) {
// TODO also consider schema hash
const fileIsUpToDate = documentHash !== undefined && writtenFilesCache[filePath] === documentHash
if (!rmBeforeWrite && fileIsUpToDate) {
return
}

if (rmBeforeWrite) {
yield* $(fs.rm(filePath, { force: true }))
}
yield* $(fs.writeFile(filePath, content))
if (documentHash) {
writtenFilesCache[filePath] = documentHash
}
})
if (rmBeforeWrite) {
yield* $(fs.rm(filePath, { force: true }))
}
yield* $(fs.writeFile(filePath, content))
if (documentHash) {
writtenFilesCache[filePath] = documentHash
}
})

const makeDataExportFile = ({
docDef,
Expand Down

0 comments on commit 35ee674

Please sign in to comment.