Skip to content

Commit 80f1596

Browse files
author
Zeno Rocha
committedMay 1, 2014
Have a unified template directory - Closes #18
1 parent 2e97ed5 commit 80f1596

12 files changed

+12
-6
lines changed
 

‎app/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
'use strict';
22

33
var banner = require('../banner');
4+
var path = require('path');
45
var util = require('util');
56
var yeoman = require('yeoman-generator');
67

78
var ElementGenerator = yeoman.generators.Base.extend({
89

910
init: function () {
11+
this.sourceRoot(path.join(__dirname, '../templates'));
12+
1013
if (!this.options['skip-install-message']) {
1114
this.log(banner);
1215
}
@@ -44,13 +47,13 @@ var ElementGenerator = yeoman.generators.Base.extend({
4447
var solutionFile = '';
4548

4649
if (this.solution == 'Polymer') {
47-
solutionFile = '_polymer.html';
50+
solutionFile = 'src/_polymer.html';
4851
}
4952
else if (this.solution == 'X-Tag') {
50-
solutionFile = '_xtag.html';
53+
solutionFile = 'src/_xtag.html';
5154
}
5255
else if (this.solution == 'VanillaJS') {
53-
solutionFile = '_vanillajs.html';
56+
solutionFile = 'src/_vanillajs.html';
5457
}
5558

5659
this.copy(solutionFile, this.elementName + '.html');

‎repo/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
'use strict';
22

33
var banner = require('../banner');
4+
var path = require('path');
45
var util = require('util');
56
var yeoman = require('yeoman-generator');
67

78
var RepoGenerator = yeoman.generators.Base.extend({
89

910
init: function () {
11+
this.sourceRoot(path.join(__dirname, '../templates'));
12+
1013
if (!this.options['skip-install-message']) {
1114
this.log(banner);
1215
}
@@ -89,13 +92,13 @@ var RepoGenerator = yeoman.generators.Base.extend({
8992
var solutionFile = '';
9093

9194
if (this.solution == 'Polymer') {
92-
solutionFile = '../../app/templates/_polymer.html';
95+
solutionFile = 'src/_polymer.html';
9396
}
9497
else if (this.solution == 'X-Tag') {
95-
solutionFile = '../../app/templates/_xtag.html';
98+
solutionFile = 'src/_xtag.html';
9699
}
97100
else if (this.solution == 'VanillaJS') {
98-
solutionFile = '../../app/templates/_vanillajs.html';
101+
solutionFile = 'src/_vanillajs.html';
99102
}
100103

101104
this.copy(solutionFile, 'src/' + this.elementName + '.html');
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.