diff --git a/lib/generator.js b/lib/generator.js index bd3a950..1b18c3b 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -44,7 +44,8 @@ _.extend(Generator.prototype, { if (!self.findProjectDirectory()) throw new Command.MustBeInProjectError; - var parts = opts.resourceName.split(path.sep); + //fix bug in win32 + var parts = opts.resourceName.replace('\\','/').split('/'); // pull the path part out of the and put it in // the "dir" option. diff --git a/lib/generators/route.js b/lib/generators/route.js index 9248a26..258c5e4 100644 --- a/lib/generators/route.js +++ b/lib/generators/route.js @@ -13,7 +13,7 @@ var RouteGenerator = Generator.create({ ] }, function (args, opts) { - var routePath = path.join(opts.dir, this.fileCase(opts.resourceName)); + var routePath = path.join(opts.dir, this.fileCase(opts.resourceName)).replace('\\','/'); var routeName = this.camelCase(routePath); var context = {