Skip to content

Complete not running #384

Closed
Closed
@OmgImAlexis

Description

@OmgImAlexis

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions