Skip to content

Commit

Permalink
Don't create root directory in subgenerator (#39)
Browse files Browse the repository at this point in the history
* Don't create root directory in subgenerator

* 0.5.0
  • Loading branch information
coaxial committed Oct 8, 2018
1 parent 45701ad commit b6e9d2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
9 changes: 0 additions & 9 deletions generators/molecule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const Generator = require('yeoman-generator');
const chalk = require('chalk');
const mkdirp = require('mkdirp');

const fsPath = require('path');

const { PLATFORMS, URLS } = require('../constants');
const { listPlatforms, listVersions, moleculePlatforms } = require('../helpers');

Expand Down Expand Up @@ -153,14 +151,7 @@ module.exports = class extends Generator {

writing() {
const { mode, repoName, targetVersions, useTravis, convergePath } = this.props;
const destinationPath = repoName;

// Create role directory if it doesn't already exist and set it as the root
if (fsPath.basename(this.destinationPath()) !== destinationPath) {
this.log(`Creating your new role in ${destinationPath}...`);
mkdirp(destinationPath);
this.destinationRoot(this.destinationPath(destinationPath));
}
// Create the rest of the directories
const dirs = ['molecule/default/tests'];

Expand Down
30 changes: 8 additions & 22 deletions 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-molecule-lxd-role",
"version": "0.4.0",
"version": "0.5.0",
"description":
"Ansible role testing with molecule using LXD containers with optional Travis CI integration",
"homepage": "",
Expand Down

0 comments on commit b6e9d2b

Please sign in to comment.