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I,WAGtE,KAAK,WAAW,CAAC,QAAS,eAAgB,OAAO,IAEpB,SAAzB,QAAQ,IAAI,WAGZ,KAAK,SAAS,KACd,KAAK,iBAAiB,OAAQ,CAAC,UAE/B,KAAK,iBAAiB,MAAO,CAAC,OAAQ,CAAC,UAE/C","file":"/npm/generator-dhboilerplate@5.0.45/generators/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/generator-dhboilerplate@5.0.45/generators/app/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Dependencies\nconst chalk = require('chalk')\nconst clear = require('clear-terminal')\nconst commandExists = require('command-exists')\nconst filesystem = require('fs-extra')\nconst Generator = require('yeoman-generator')\nconst yosay = require('yosay')\n\n// Import Helpers & Package File\nconst _pkg = require('../../package.json')\nconst branding = require('./helpers/messages/_branding')\nconst logMessage = require('./helpers/messages/_logMessage')\n\n// Install CMS Stuff\n// const installCraftCMS = require('./modules/installs/_instsallCraftCMS')\nconst installCraftCMS = require('./modules/writings/craftCMS')\nconst installCraftCMS3 = require('./modules/writings/craftCMS3')\nconst installWordpress = require('./modules/writings/wordpress')\n\n// Package JSON\nconst writePackageJSON = require('./modules/writings/package')\n\n// Config Files for moving Files & Folders\nconst filesEnvironment = require('./config/_filesEnvironment')\nconst filesProject = require('./config/_filesProject')\nconst filesProjectTpl = require('./config/_filesProjectTpl')\nconst foldersProject = require('./config/_foldersProject')\nconst foldersProjectTpl = require('./config/_foldersProjectTpl')\n\n// Importing Modules\nconst promptsFunction = require('./modules/_prompts')\n\n// Generator\nmodule.exports = class extends Generator {\n\n    // Constructor\n    constructor(args, opts) {\n        super(args, opts)\n\n        // Default\n        this.promptsFunction = promptsFunction.bind(this)\n\n        // Messages\n        this.branding = branding.bind(this)\n        this.logMessage = logMessage.bind(this)\n\n        // Files & Folders\n        this.filesEnvironment = filesEnvironment\n        this.filesProject = filesProject\n        this.filesProjectTpl = filesProjectTpl\n        this.foldersProject = foldersProject\n        this.foldersProjectTpl = foldersProjectTpl\n\n        // CMS Stuff\n        this.installCraftCMS = installCraftCMS.bind(this)\n        this.installCraftCMS3 = installCraftCMS3.bind(this)\n        this.installWordpress = installWordpress.bind(this)\n\n        // Package JSON\n        this.writePackageJSON = writePackageJSON.bind(this)\n\n        this.commands = {\n            composer: false,\n            yarn: false,\n            git: false,\n            wp: false\n        }\n    }\n\n    // Initializing\n    async initializing() {\n        this.logMessage({message: 'Initializing the Generator', short: false})\n        await Promise.all(Object.keys(this.commands)\n            .map(command => {\n                return commandExists(command)\n                    .then(commandResult => {\n                        this.commands[commandResult] = true\n                    })\n                    .catch(error => console.warn(error))\n            }))\n    }\n\n    // Prompting\n    prompting() {\n        // Have Yeoman greet the user.\n        this.log(yosay(\n            `Welcome to the impressive ${chalk.magenta('dhBoilerplate')} generator!`\n        ))\n\n        if (process.env.NODE_ENV !== 'test') {\n            clear()\n        }\n\n        // Branding\n        this.log(this.branding(_pkg.version, _pkg.author.name, _pkg.author.email, _pkg.repository.url))\n        this.logMessage({message: 'Prompting', short: false})\n\n        // Execute function so we get its returned array;\n        const prompts = this.promptsFunction()\n        return this.prompt(prompts).then((props) => {\n            // To access props later use this.props.someAnswer;\n            this.props = props\n        })\n    }\n\n    // Configuration\n    async configuration() {\n        this.logMessage({message: 'Configure Project', short: false})\n\n        // Install Craft CMS\n        if (this.props.projectType === 'craftCMS' && this.props.craftCMSInstall) {\n            try {\n                await this.installCraftCMS().download(this)\n            } catch (e) {\n                console.error(e)\n            }\n        }\n\n        // Install Craft CMS 3\n        if (this.props.projectType === 'craftCMS3' && this.props.craftCMS3Install && this.commands.composer) {\n            try {\n                await this.installCraftCMS3().download(this)\n            } catch (e) {\n                console.error(e)\n            }\n        }\n\n        // WordPress\n        if (this.props.projectType === 'wordpress' && this.props.wordpressInstall && this.commands.wp) {\n            try {\n                await this.installWordpress().download(this)\n            } catch (e) {\n                console.error(e)\n            }\n        }\n    }\n\n    // Writing\n    async writing() {\n        this.logMessage({message: 'Writing files', short: false})\n\n        // Package JSON\n        this.writePackageJSON().writing(this)\n\n        // Craft CMS\n        if (this.props.projectType === 'craftCMS') {\n            this.logMessage({message: 'Moving Craft Folders'});\n            try {\n                await this.installCraftCMS().writing(this)\n            } catch (e) {\n                console.error(e)\n            }\n        }\n\n        // Craft CMS 3\n        if (this.props.projectType === 'craftCMS3') {\n            this.logMessage({message: 'Moving Craft Folders'});\n            try {\n                await this.installCraftCMS3().writing(this)\n            } catch (e) {\n                console.error(e)\n            }\n        }\n\n        // Environment Files\n        this.logMessage({message: 'Moving Environment Files'})\n        this.filesEnvironment.files.forEach(file => {\n            this.fs.copyTpl(\n                this.templatePath(file.src),\n                this.destinationPath(file.dest),\n                this.props\n            )\n        })\n\n        // Project Folders\n        this.logMessage({message: 'Moving Project Folders'})\n\n        // With Yeoman Logic\n        this.foldersProjectTpl.files.forEach(file => {\n            if (file.projectContext.includes(this.props.projectType)) {\n                this.fs.copyTpl(\n                    this.templatePath(file.src),\n                    this.destinationPath(file.dest),\n                    this.props\n                )\n            }\n        })\n\n        // Without Yeoman Logic\n        this.foldersProject.files.forEach(file => {\n            if (file.projectContext.includes(this.props.projectType)) {\n                this.fs.copy(\n                    this.templatePath(file.src),\n                    this.destinationPath(file.dest)\n                )\n            }\n        })\n\n        // Project Files\n        this.logMessage({message: 'Moving Project Files'})\n        this.filesProject.files.forEach(file => {\n            if (file.projectContext.includes(this.props.projectType)) {\n                this.fs.copy(\n                    this.templatePath(file.src),\n                    this.destinationPath(file.dest)\n                )\n            }\n        })\n\n        // Project Files Tpl\n        this.filesProjectTpl.files.forEach(file => {\n            this.fs.copyTpl(\n                this.templatePath(file.src),\n                this.destinationPath(file.dest),\n                this.props\n            )\n        })\n\n        // Git\n        this.logMessage({\n            message: '> Initializing git and make first commit',\n            short: true,\n            color: 'green'\n        })\n\n        if (this.commands.git) {\n            try {\n                await this.spawnCommandSync('git', ['init'])\n                if (process.env.NODE_ENV === 'test') {\n                    return\n                }\n                await this.spawnCommandSync('git', ['add', '-A'])\n                await this.spawnCommandSync('git', ['commit', '-m \"initial commit\"'])\n\n            } catch (e) {\n                console.error(e)\n            }\n        }\n    }\n\n    // Install\n    install() {\n        this.logMessage({message: 'Install', short: false})\n        this.logMessage({message: 'Download all the NPM Modules…'})\n        this.logMessage({message: 'Give me a moment to do that…'})\n\n        if (this.commands.yarn) {\n            this.yarnInstall()\n        } else {\n            this.npmInstall()\n        }\n    }\n\n    end() {\n        clear()\n        this.log(yosay(\n            `It was an honor to me to setup this project with you ${chalk.red('<3')}!`\n        ))\n\n        this.logMessage({message: 'Init Project', short: false})\n\n        if (process.env.NODE_ENV === 'test') {\n            return\n        }\n        if (this.commands.yarn) {\n            this.spawnCommandSync('yarn', ['start'])\n        } else {\n            this.spawnCommandSync('npm', ['run'], ['start'])\n        }\n    }\n}\n"]}