function init() {
    inquirer.prompt(questions)
    .then(readmeObject => {
        //console.log(readmeObject);
        if(readmeObject.deployedProject) {
            inquirer.prompt(
                [{
                    type: "input",
                    name: "deployedUrl",
                    message: "Please provide a link to the application. (Required)",
                    validate: deployedUrl => {
                        if(deployedUrl) {
                            return true;
                        } else {
                            console.log("Please provide the url for deployed application.");
                            return false;
                        }
                    }
                }]
            )
            .then(deployedUrl => {
                readmeObject.deployedUrl = deployedUrl.deployedUrl;
                //console.log(readmeObject);
                return readmeObject;
            })
            .then(readmeObject => {
                var fileData = generateMarkdown(readmeObject);
                //console.log(fileData);
                fs.writeFile("./README.md",fileData, err => {
                    console.log(err);
                });
            });
        } else {
            var fileData = generateMarkdown(readmeObject);
            //console.log(fileData);
            fs.writeFile("../README.md",fileData, err => {
                console.log(err);
            });
        }
    });
}
// TODO: Create a function to initialize app
Create a function to initialize app
Create a function to initialize app
function init() {
    inquirer.prompt(questions)
    .then(readmeObject => {
        if(readmeObject.deployedProject) {
            inquirer.prompt(
                [{
                    type: "input",
                    name: "deployedUrl",
                    message: "Please provide a link to the application. (Required)",
                    validate: deployedUrl => {
                        if(deployedUrl) {
                            return true;
                        } else {
                            console.log("Please provide the url for deployed application.");
                            return false;
                        }
                    }
                }]
            )
            .then(deployedUrl => {
                readmeObject.deployedUrl = deployedUrl.deployedUrl;
                return readmeObject;
            })
            .then(readmeObject => {
                var fileData = generateMarkdown(readmeObject);
                fs.writeFile("./README.md",fileData, err => {
                    console.log(err);
                });
            });
        } else {
            var fileData = generateMarkdown(readmeObject);
            fs.writeFile("../README.md",fileData, err => {
                console.log(err);
            });
        }
    });
}
function init ( ) { inquirer . prompt ( questions ) . then ( readmeObject => { if ( readmeObject . deployedProject ) { inquirer . prompt ( [ { type : "input" , name : "deployedUrl" , message : "Please provide a link to the application. (Required)" , validate : deployedUrl => { if ( deployedUrl ) { return true ; } else { console . log ( "Please provide the url for deployed application." ) ; return false ; } } } ] ) . then ( deployedUrl => { readmeObject . deployedUrl = deployedUrl . deployedUrl ; return readmeObject ; } ) . then ( readmeObject => { var fileData = generateMarkdown ( readmeObject ) ; fs . writeFile ( "./README.md" , fileData , err => { console . log ( err ) ; } ) ; } ) ; } else { var fileData = generateMarkdown ( readmeObject ) ; fs . writeFile ( "../README.md" , fileData , err => { console . log ( err ) ; } ) ; } } ) ; }
TODO: Create a function to initialize app
TODO : Create a function to initialize app
//console.log(readmeObject); //console.log(readmeObject); //console.log(fileData); //console.log(fileData);