Skip to content

Commit

Permalink
path fixed to find the right package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaine Gunn committed Feb 22, 2018
1 parent 63303aa commit e03f528
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 20 deletions.
16 changes: 9 additions & 7 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var path = require('path');
var wiring = require('html-wiring');
var pathExists = require('path-exists');
var find = require('find');
var pkg = require('./../../../package.json');
var pkg = require('./../../../../package.json');

var appJs = pkg.paths.scripts;
var appLess = pkg.paths.styles;
Expand All @@ -43,7 +43,7 @@ module.exports = yeoman.Base.extend({
var generator = this;

this.log(yosay(
'Welcome to the ' + chalk.red('???????') + ' generator! \nI create stub files for new AEM components.'
'Welcome to the ' + chalk.red('AEM Generator') + '! \nI create stub files for new AEM components.'
));

var prompts = [{
Expand Down Expand Up @@ -149,11 +149,13 @@ module.exports = yeoman.Base.extend({
/*
* JS FILE
*/
this.fs.copyTpl(
this.templatePath('componentJavaScript.js'),
this.destinationPath(path.join(jsPath, this.props.folderName, this.props.jsFileName + '.js')),
this.props
);
if (this.props.jsFileName) {
this.fs.copyTpl(
this.templatePath('componentJavaScript.js'),
this.destinationPath(path.join(jsPath, this.props.folderName, this.props.jsFileName + '.js')),
this.props
);
}

/*
* JAVA FILE TODO
Expand Down
7 changes: 1 addition & 6 deletions generators/app/templates/componentJavaScript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
console.log('I should not be here, but I should work.');


const myObject = document.querySelectorAll('div');

console.log(myObject);
// this is where all the JS goes.
4 changes: 0 additions & 4 deletions generators/app/templates/componentLess.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* Main .less for <%= lessName %>
*/

.component-<%= lessName %> {

}
1 change: 0 additions & 1 deletion generators/app/templates/htl.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div class="component-<%= lessName %>">
<h2><%= xmlContentName %></h2>

</div>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-aem-component",
"version": "1.0.0",
"version": "1.0.2",
"description": "A basic conponent generator for Adobe Expirecne Manager (AEM).",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit e03f528

Please sign in to comment.