Skip to content

Commit e6e0188

Browse files
committed
fix: normalize relative paths before registering provider to rc file
1 parent e996e5b commit e6e0188

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commands/Make/Provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import { args, flags } from '@adonisjs/ace'
10+
import slash from 'slash'
1111
import { join, extname } from 'path'
12+
import { args, flags } from '@adonisjs/ace'
1213
import { RcFile as SinkRcFile } from '@adonisjs/sink'
1314
import { RcFile } from '@ioc:Adonis/Core/Application'
1415

@@ -71,9 +72,9 @@ export default class MakeProvider extends BaseGenerator {
7172
const rcFile = new SinkRcFile(ADONIS_ACE_CWD()!)
7273

7374
if (this.ace) {
74-
rcFile.addAceProvider(`./${relativePath.replace(extname(relativePath), '')}`)
75+
rcFile.addAceProvider(`./${(slash(relativePath)).replace(extname(relativePath), '')}`)
7576
} else {
76-
rcFile.addProvider(`./${relativePath.replace(extname(relativePath), '')}`)
77+
rcFile.addProvider(`./${slash(relativePath).replace(extname(relativePath), '')}`)
7778
}
7879

7980
rcFile.commit()

0 commit comments

Comments
 (0)