Skip to content

Closes Codeception/CodeceptJS#16 , don't create the output folder if it exists #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/command/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ module.exports = function() {

});
}


`;

module.exports = function (initPath) {
Expand All @@ -41,8 +39,6 @@ module.exports = function (initPath) {
print(` Welcome to ${colors.magenta.bold('CodeceptJS')} initialization tool`);
print(" It will prepare and configure a test environment for you");
print();


if (!path) {
print(`No test root specified.`);
print(`Test root is assumed to be ${colors.yellow.bold(testsPath)}`);
Expand All @@ -62,7 +58,6 @@ module.exports = function (initPath) {
return;
}


inquirer.prompt(
[
{
Expand Down Expand Up @@ -150,9 +145,12 @@ module.exports = function (initPath) {


if (config.output) {

fs.mkdirSync(path.join(testsPath, config.output));
success("Directory for temporaty output files created at `_output`");
if (!fileExists(config.output)) {
fs.mkdirSync(path.join(testsPath, config.output));
success("Directory for temporaty output files created at `_output`");
} else {
print("Directory for temporaty output files already presents at '" + config.output + "'. Don't create it!");
}
}

success("Almost done! Create your first test by executing `codeceptjs gt` (generate test) command");
Expand Down