File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
storage/framework/core/orm/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -843,8 +843,7 @@ export async function generateApiRoutes(modelFiles: string[]): Promise<void> {
843
843
export async function deleteExistingModels ( modelStringFile ?: string ) : Promise < void > {
844
844
const typePath = path . frameworkPath ( `orm/src/types.ts` )
845
845
846
- if ( fs . existsSync ( typePath ) )
847
- await fs . writeFile ( typePath , '' )
846
+ await fs . writeFile ( typePath , '' )
848
847
849
848
if ( modelStringFile ) {
850
849
const modelPath = path . frameworkPath ( `orm/src/models/${ modelStringFile } .ts` )
@@ -855,6 +854,7 @@ export async function deleteExistingModels(modelStringFile?: string): Promise<vo
855
854
}
856
855
857
856
const modelPaths = globSync ( [ path . frameworkPath ( `orm/src/models/*.ts` ) ] , { absolute : true } )
857
+
858
858
await Promise . all (
859
859
modelPaths . map ( async ( modelPath ) => {
860
860
if ( fs . existsSync ( modelPath ) ) {
@@ -891,8 +891,7 @@ export async function deleteExistingModelNameTypes(): Promise<void> {
891
891
export async function deleteAttributeTypes ( ) : Promise < void > {
892
892
const typeFile = path . frameworkPath ( 'types/attributes.ts' )
893
893
894
- if ( fs . existsSync ( typeFile ) )
895
- await fs . promises . unlink ( typeFile )
894
+ await fs . writeFile ( typeFile , '' )
896
895
}
897
896
898
897
export async function deleteExistingModelRequest ( modelStringFile ?: string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments