From 98f6719bb3616b5abf09dc75bf950cb27099ac11 Mon Sep 17 00:00:00 2001 From: Adam Keenan Date: Mon, 30 Mar 2015 00:34:17 -0400 Subject: [PATCH] When using endpointDirectory includes endpoint name --- endpoint/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/endpoint/index.js b/endpoint/index.js index 2b3d7eb22..45eba2c72 100644 --- a/endpoint/index.js +++ b/endpoint/index.js @@ -70,7 +70,15 @@ Generator.prototype.registerEndpoint = function registerEndpoint() { }; Generator.prototype.createFiles = function createFiles() { - var dest = this.config.get('endpointDirectory') || 'server/api/' + this.name; + var destBase = this.config.get('endpointDirectory'); + var dest = 'server/api/' + this.name; + if (destBase) { + if (destBase.charAt(destBase.length - 1) !== '/') { + destBase += '/'; + } + dest = destBase + this.name; + } + this.sourceRoot(path.join(__dirname, './templates')); ngUtil.processDirectory(this, '.', dest); };