Skip to content

Commit

Permalink
fixed(windows): issue where slashes weren't normalized when determini…
Browse files Browse the repository at this point in the history
…ng model's name
  • Loading branch information
tomgobich committed Nov 8, 2024
1 parent 0346887 commit e672460
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/model_service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FileService from './file_service.js'
import { generators } from '@adonisjs/core/app'
import string from '@adonisjs/core/helpers/string'
import { slash } from '@adonisjs/core/helpers'
import { ApplicationService } from '@adonisjs/core/types'
import { fsReadAll } from '@adonisjs/core/helpers'
import UtilService from './util_service.js'
Expand Down Expand Up @@ -46,7 +47,7 @@ export default class ModelService {
const modelsPath = this.app.modelsPath()
const modelFilePaths = await fsReadAll(modelsPath, { pathType: 'absolute' })
const promises = modelFilePaths.map(async (filePath) => {
const name = generators.modelName(filePath.split('/').pop()!)
const name = generators.modelName(slash(filePath).split('/').pop()!)
return this.getModelInfo({ name, filePath }, name)
})

Expand Down

0 comments on commit e672460

Please sign in to comment.