Skip to content

Commit 870aa5c

Browse files
chore: wip
1 parent 5432600 commit 870aa5c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

storage/framework/core/orm/src/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,7 @@ export async function generateApiRoutes(modelFiles: string[]): Promise<void> {
843843
export async function deleteExistingModels(modelStringFile?: string): Promise<void> {
844844
const typePath = path.frameworkPath(`orm/src/types.ts`)
845845

846-
if (fs.existsSync(typePath))
847-
await fs.writeFile(typePath, '')
846+
await fs.writeFile(typePath, '')
848847

849848
if (modelStringFile) {
850849
const modelPath = path.frameworkPath(`orm/src/models/${modelStringFile}.ts`)
@@ -855,6 +854,7 @@ export async function deleteExistingModels(modelStringFile?: string): Promise<vo
855854
}
856855

857856
const modelPaths = globSync([path.frameworkPath(`orm/src/models/*.ts`)], { absolute: true })
857+
858858
await Promise.all(
859859
modelPaths.map(async (modelPath) => {
860860
if (fs.existsSync(modelPath)) {
@@ -891,8 +891,7 @@ export async function deleteExistingModelNameTypes(): Promise<void> {
891891
export async function deleteAttributeTypes(): Promise<void> {
892892
const typeFile = path.frameworkPath('types/attributes.ts')
893893

894-
if (fs.existsSync(typeFile))
895-
await fs.promises.unlink(typeFile)
894+
await fs.writeFile(typeFile, '')
896895
}
897896

898897
export async function deleteExistingModelRequest(modelStringFile?: string): Promise<void> {

0 commit comments

Comments
 (0)