Skip to content

Complete not running #384

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
OmgImAlexis opened this issue Mar 8, 2017 · 1 comment
Closed

Complete not running #384

OmgImAlexis opened this issue Mar 8, 2017 · 1 comment

Comments

@OmgImAlexis
Copy link

I'm trying to use the new complete handler that was added and it doesn't seem to be running.
When I use completeMessage I get the output of the message but when I use complete I get nothing but the default vue-cli · Generated "my-project"..

Here's my whole meta.js.

module.exports = {
    prompts: {
        name: {
            type: "string",
            required: true,
            label: "Project name"
        },
        description: {
            type: "string",
            required: true,
            label: "Project description",
            default: "A Vue.js project"
        },
        author: {
            type: "string",
            label: "Author"
        }
    },
    complete(data) {
        if (!data.inPlace) {
            const exec = require('child_process').exec;
            exec(`cd ${data.destDirName} && yarn install`, (error, stdout, stderr) => {
                if (error) {
                    console.error(`exec error: ${error}`);
                    return;
                }
                console.log(`stdout: ${stdout}`);
                console.log(`stderr: ${stderr}`);
            }).then(() => {
                console.log(`To get started:\n\n  cd ${data.destDirName}\n  yarn start`);
            });
        }
    },
    helpers: {
        secret() {
            return Math.random().toString(36).substr(2);
        }
    },
    skipInterpolation: "**/*.vue"
}
@OmgImAlexis
Copy link
Author

I even tried something simpler with no success.

module.exports = {
    complete(data, {logger, chalk}) {
        logger.log('test')
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant