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GA,UAAU,UAAU,gBAAkB,WACrC,KAAK,OAAO,IAAI,MAAM,KAAK,MAAM,4CAA6C,CAAC,UAAW,KAC1F,KAAK,OAAO,IAAI,wLAA0L,CAAC,UAAW,KACtN,KAAK,OAAO,IAAI,kCAAmC,CAAC,UAAW,IAChE","file":"/npm/generator-wordpress-bob@2.0.1/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/generator-wordpress-bob@2.0.1/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","/**================================\n * Setting up the basics\n **===============================*/\n\n// Requirements\nvar util = require('util'),\n\tpath = require('path'),\n\tfs = require('fs'),\n\tyeoman = require('yeoman-generator'),\n\twrench = require('wrench'),\n\tchalk = require('chalk'),\n\tmkdirp = require('mkdirp'),\n\tgit = require('simple-git')(),\n\twp = require('wp-util'),\n\twordpress = require('../util/wordpress'),\n\tart = require('../util/art'),\n\tLogger = require('../util/log'),\n\tConfig = require('../util/config');\n\n// Export the module\nmodule.exports = Generator;\n\n// Extend the base generator\nfunction Generator(args, options, config) {\n\tyeoman.generators.Base.apply(this, arguments);\n\n\t// Log level option\n\tthis.option('log', {\n\t\tdesc: 'The log verbosity level: [ verbose | log | warn | error ]',\n\t\tdefaults: 'log',\n\t\talias: 'l',\n\t\tname: 'level'\n\t});\n\n\t// Enable advanced features\n\tthis.option('advanced', {\n\t\tdesc: 'Makes advanced features available',\n\t\talias: 'a'\n\t});\n\n\t// Shortcut for --log=verbose\n\tthis.option('verbose', {\n\t\tdesc: 'Verbose logging',\n\t\talias: 'v'\n\t});\n\tif (this.options.verbose) {\n\t\tthis.options.log = 'verbose';\n\t}\n\n\t// Setup the logger\n\tthis.logger = Logger({\n\t\tlevel: this.options.log\n\t});\n\n\t// Log the options\n\ttry {\n\t\tthis.logger.verbose('\\nOptions: ' + JSON.stringify(this.options, null, '  '));\n\t} catch(e) {\n\t\t// This is here because when a generator is run by selecting it after running `yo`,\n\t\t// the options is a circular data structure, causing an error when converting to json.\n\t\t// Verbose cannot be called this way, so there is no need to log anything.\n\t}\n\n\t// Load the config files\n\tthis.conf = new Config();\n\n};\nutil.inherits(Generator, yeoman.generators.Base);\n\n/**================================\n * Easy as 1, 2, 3...err....9 maybe 10 or 11\n **===============================*/\n\n\n// Ask the user what they want done\nGenerator.prototype.ohTellMeWhatYouWantWhatYouReallyReallyWant = function() {\n\n\t// This is an async step\n\tvar done = this.async();\n\n\t// Display welcome message\n\tthis.logger.log(art.wp, {logPrefix: ''});\n\t\n\t// Get the current version number of wordpress\n\tthis.logger.verbose('Getting current WP version');\n\twordpress.getCurrentVersion(function(err, ver) {\n\t\tif (err) this.logger.warn('Error getting WP versions.  Falling back to ' + ver);\n\t\tthis.logger.verbose('Got current WP version: ' + ver);\n\t\tthis.conf.set('wpVer', ver);\n\t\tgetInput();\n\t}.bind(this));\n\n\t// Get the input\n\tvar getInput = function getInput() {\n\t\tthis.prompt(require('./prompts')(this.options.advanced, this.conf.get()), function(input) {\n\t\t\tthis.prompt([{\n\t\t\t\tmessage: 'Does this all look correct?',\n\t\t\t\tname: 'confirm',\n\t\t\t\ttype: 'confirm'\n\t\t\t}], function(i) {\n\t\t\t\tif (i.confirm) {\n\t\t\t\t\t// Set port\n\t\t\t\t\tvar portRegex = /:[\\d]+$/;\n\t\t\t\t\tvar port = input.url.match(portRegex);\n\t\t\t\t\tif (port) input.port = port[0].replace(':', '');\n\n\t\t\t\t\t// Remove port from url\n\t\t\t\t\tinput.url = input.url.replace(portRegex, '');\n\n\t\t\t\t\t// Set customDirs to true if installing as a submodule\n\t\t\t\t\tif (input.submodule) {\n\t\t\t\t\t\tinput.customDirs = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set dirs if custom dir's is not set\n\t\t\t\t\tif (!input.customDirs) {\n\t\t\t\t\t\tinput.wpDir = '.';\n\t\t\t\t\t\tinput.contentDir = 'wp-content';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a wordpress site instance\n\t\t\t\t\tthis.wpSite = new wp.Site({\n\t\t\t\t\t\tcontentDirectory: input.contentDir,\n\t\t\t\t\t\twpBaseDirectory: input.wpDir,\n\t\t\t\t\t\tdatabaseCredentials: {\n\t\t\t\t\t\t\thost: input.dbHost,\n\t\t\t\t\t\t\tuser: input.dbUser,\n\t\t\t\t\t\t\tpassword: input.dbPass,\n\t\t\t\t\t\t\tname: input.dbName,\n\t\t\t\t\t\t\tprefix: input.tablePrefix,\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// Save the users input\n\t\t\t\t\tthis.conf.set(input);\n\t\t\t\t\tthis.logger.verbose('User Input: ' + JSON.stringify(this.conf.get(), null, '  '));\n\t\t\t\t\tthis.logger.log(art.go, {logPrefix: ''});\n\t\t\t\t\tdone();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log();\n\t\t\t\t\tgetInput();\n\t\t\t\t}\n\t\t\t}.bind(this));\n\t\t}.bind(this));\n\t}.bind(this);\n\n};\n\n// .gitignore\nGenerator.prototype.justIgnoreMe = function() {\n\tif (this.conf.get('git')) {\n\t\tthis.logger.verbose('Copying .gitignore file');\n\t\tthis.fs.copyTpl(this.templatePath('gitignore.tmpl'), this.destinationPath('.gitignore'), { conf: this.conf });\n\t}\n};\n\n// Git setup and initial commit of WP stuff\nGenerator.prototype.gitIsTheShit = function() {\n\n\t// Using Git? Init it...\n\tif (this.conf.get('git')) {\n\t\tvar done = this.async();\n\n\t\tthis.logger.log('Initializing Git');\n\t\tgit.init(function(err) {\n\t\t\tif (err) this.logger.error(err);\n\n\t\t\tthis.logger.verbose('Git init complete');\n\t\t\tdone();\n\t\t}.bind(this));\n\t}\n\n};\n\n// Setup Vagrant config\nGenerator.prototype.heIsSuchAVagrant = function() {\n\n\tif (this.conf.get('vagrant')) {\n\t\tthis.logger.log('Setting up Vagrant');\n\t\tthis.logger.verbose('Copying vagrant file');\n\t\tthis.fs.copyTpl(this.templatePath('Vagrantfile'), this.destinationPath('Vagrantfile'), this);\n\t\tthis.logger.verbose('Copying puppet files');\n\t\tthis.fs.copy(this.templatePath('puppet/'), this.destinationPath('puppet/'));\n\t\tthis.fs.copyTpl(this.templatePath('puppet/manifests/default.pp'), this.destinationPath('puppet/manifests/default.pp'), this);\n\t\tthis.logger.verbose('Finished setting up Vagrant');\n\t}\n\n};\n\n// Install wordpress\nGenerator.prototype.wordWhatUp = function() {\n\n\tvar done = this.async();\n\n\tif (this.conf.get('submodule')) {\n\t\tthis.logger.log('Installing WordPress ' + this.conf.get('wpVer') + ' as a submodule (be patient)');\n\t\tgit.submoduleAdd(wordpress.repo, this.conf.get('wpDir'), function(err) {\n\t\t\tif (err) this.logger.error(err);\n\n\t\t\tthis.logger.verbose('Submodule added');\n\t\t\tvar cwd = process.cwd();\n\t\t\tgit._baseDir = this.conf.get('wpDir');\n\t\t\tthis.logger.verbose('Checking out WP version ' + this.conf.get('wpVer'));\n\t\t\tgit.checkout(this.conf.get('wpVer'), function(err) {\n\t\t\t\tif (err) this.logger.error(err);\n\t\t\t\tgit._baseDir = cwd;\n\t\t\t\tthis.logger.verbose('WordPress installed');\n\t\t\t\tdone();\n\t\t\t}.bind(this));\n\t\t}.bind(this));\n\n\t} else {\n\n\t\tthis.logger.log('Installing WordPress ' + this.conf.get('wpVer'));\n\t\tthis.remote('wordpress', 'wordpress', this.conf.get('wpVer'), function(err, remote) {\n\t\t\tif (err) {\n\t\t\t\tthis.logger.error(err);\n\t\t\t\treturn done(err);\n\t\t\t}\n\t\t\tremote.directory('.', this.conf.get('wpDir'));\n\t\t\tthis.logger.log('WordPress installed');\n\t\t\tdone();\n\t\t}.bind(this));\n\n\t}\n\t\n};\n\n// Setup custom directory structure\nGenerator.prototype.somethingsDifferent = function() {\n\n\tif (this.conf.get('submodule') || this.conf.get('customDirs')) {\n\n\t\tthis.logger.verbose('Copying index.php');\n\t\tthis.fs.copyTpl(this.templatePath('index.php.tmpl'), this.destinationPath('index.php'), { conf: this.conf });\n\n\t\tthis.logger.log('Setting up the content directory');\n\t\tthis.remote('wordpress', 'wordpress', this.conf.get('wpVer'), function(err, remote) {\n\t\t\tremote.directory('wp-content', this.conf.get('contentDir'));\n\t\t\tthis.logger.verbose('Content directory setup');\n\t\t}.bind(this));\n\n\t}\n\n};\n\n// wp-config.php\nGenerator.prototype.muHaHaHaConfig = function() {\n\n\tvar done = this.async();\n\n\tthis.logger.log('Getting salt keys');\n\twp.misc.getSaltKeys(function(err, saltKeys) {\n\t\tif (err) {\n\t\t\tthis.logger.error('Failed to get salt keys, remember to change them.');\n\t\t}\n\t\tthis.logger.verbose('Salt keys: ' + JSON.stringify(saltKeys, null, '  '));\n\t\tthis.conf.set('saltKeys', saltKeys);\n\t\tthis.logger.verbose('Copying wp-config');\n\t\tthis.fs.copyTpl(this.templatePath('wp-config.php.tmpl'), this.destinationPath('wp-config.php'), { conf: this.conf });\n\t\tdone();\n\t}.bind(this));\n\n};\n\n// local-config.php\nGenerator.prototype.localConf = function() {\n\tif (this.conf.get('createLocalConfig')) {\n\t\tthis.logger.verbose('Copying local-config');\n\t\tthis.fs.copyTpl(this.templatePath('local-config.php.tmpl'), this.destinationPath('local-config.php'), { conf: this.conf });\n\t}\n};\n\n// Create Language directory\nGenerator.prototype.doveIlBagno = function() {\n\n\t// Only do this if the user specified a language\n\tif (this.conf.get('wpLang')) {\n\t\tthis.logger.log('Setting up locale files');\n\t\twp.locale.getLanguage(this.conf.get('wpLang'), this.conf.get('contentDir'), function (err) {\n\t\t\tif (err) this.logger.error(err);\n\t\t}.bind(this));\n\t}\n\n};\n\n// Write all these newly created files to disk so that the rest of the generator doesn't fail\nGenerator.prototype.doNotFearCommitment = function() {\n\n\tvar done = this.async();\n\n\tthis.logger.log('Writing WP files to disk')\n\n\tthis.fs.commit(function (err) {\n\t\tif (err) this.logger.error(err);\n\n\t\tthis.logger.verbose('Done WP writing files');\n\t\tdone();\n\t}.bind(this));\n};\n\n// Set some permissions\n/* @TODO Thinking that maybe permissions should be left up to the user \n   BUT, it seems that the theme stuff needs some permissions set to work....\n*/\nGenerator.prototype.thisIsSparta = function() {\n\n\tif (fs.existsSync('.')) {\n\t\tthis.logger.log('Setting Permissions: 0755 on .');\n\t\twrench.chmodSyncRecursive('.', 0755);\n\t\tthis.logger.verbose('Done setting permissions on .');\n\t}\n\n\tif (fs.existsSync(this.conf.get('contentDir'))) {\n\t\tthis.logger.log('Setting Permissions: 0775 on ' + this.conf.get('contentDir'));\n\t\twrench.chmodSyncRecursive(this.conf.get('contentDir'), 0775);\n\t\tthis.logger.verbose('Done setting permissions on ' + this.conf.get('contentDir'));\n\t}\n\n};\n\n// Commit the wordpress stuff\nGenerator.prototype.commitThisToMemory = function() {\n\n\tif (this.conf.get('git')) {\n\t\tvar done = this.async();\n\n\t\tthis.logger.verbose('Committing WP to Git');\n\t\tgit.add('.', function(err) {\n\t\t\tif (err) this.logger.error(err);\n\t\t}.bind(this)).commit('Installed wordpress', function(err, d) {\n\t\t\tif (err) this.logger.error(err);\n\t\t\tthis.logger.verbose('Done committing: ' + JSON.stringify(d, null, '  '));\n\t\t\tdone();\n\t\t}.bind(this));\n\t}\n\n};\n\n// Check that the database exists, create it otherwise\nGenerator.prototype.hazBaseData = function() {\n\n\tvar done = this.async();\n\tthis.wpSite.database.createIfNotExists(function(err) {\n\t\tif (err) {\n\t\t\tthis.logger.warn('Cannot access database');\n\t\t\tthis.logger.warn('Make sure you create the database and update the credentials in the wp-config.php');\n\t\t}\n\t\tdone();\n\t}.bind(this));\n\n};\n\n// Install and activate the theme\nGenerator.prototype.dumbledoreHasStyle = function() {\n\n\tif (this.conf.get('installTheme')) {\n\t\tvar done = this.async();\n\n\t\tthis.logger.log('Starting to install theme');\n\t\twordpress.installTheme(this, this.conf.get(), function() {\n\t\t\t//@TODO You need to run the install before doing this\n\t\t\t//see if I can get yeopress to do that.\n\t\t\t//wordpress.activateTheme(this.conf.get(), done);\n\t\t\tthis.logger.verbose('Theme install complete');\n\t\t\tdone();\n\t\t}.bind(this));\n\t}\n\n};\n\n// Write all the newly downloaded theme files to disk\nGenerator.prototype.gandalfGotThemSkillzTho = function() {\n\n\tif (this.conf.get('installTheme')) {\n\t\tvar done = this.async();\n\n\t\tthis.logger.log('Writing theme files to disk')\n\n\t\tthis.fs.commit(function (err) {\n\t\t\tif (err) this.logger.error(err);\n\n\t\t\tthis.logger.verbose('Done writing theme files');\n\t\t\tdone();\n\t\t}.bind(this));\n\t}\n\n};\n\n// Setup theme\nGenerator.prototype.dummyYouHaveToPlugItInFirst = function() {\n\n\tif (this.conf.get('installTheme')) {\n\t\tthis.logger.log('Starting theme setup');\n\t\twordpress.setupTheme(this, this.conf.get(), this.async());\n\t\tthis.logger.verbose('Theme setup complete');\n\t}\n\n};\n\n// Commit again with the template\nGenerator.prototype.gitMeMOARCommits = function() {\n\n\tif (this.conf.get('git') && this.conf.get('installTheme')) {\n\t\tvar done = this.async();\n\n\t\tthis.logger.verbose('Committing theme to Git');\n\t\tgit.add('.', function(err) {\n\t\t\tif (err) this.logger.error(err);\n\t\t}.bind(this)).commit('Installed theme', function(err, d) {\n\t\t\tif (err) this.logger.error(err);\n\n\t\t\tthis.logger.verbose('Done committing: ', JSON.stringify(d, null, '  '));\n\t\t\tdone();\n\t\t}.bind(this));\n\t}\n\n};\n\n// Run vagrant up\nGenerator.prototype.vagrantUp = function() {\n\tif (this.conf.get('vagrant')) {\n\t\tvar done = this.async();\n\t\tthis.logger.log('Running vagrant up');\n\t\tvar child = require('child_process').exec('vagrant up', function(err) {\n\t\t\tif (err) return this.logger.error(err);\n\t\t\tthis.logger.verbose('Finished running Vagrant');\n\t\t\tdone();\n\t\t}.bind(this));\n\t\tchild.on('error', function(err) {\n\t\t\tprocess.stderr.write(err);\n\t\t});\n\t\tchild.stdout.on('data', function(data) {\n\t\t\tprocess.stdout.write(data);\n\t\t});\n\t\tchild.stderr.on('data', function(err) {\n\t\t\tprocess.stderr.write(err);\n\t\t});\n\t}\n};\n\n// Save settings to .yeopress file\nGenerator.prototype.saveDaSettings = function() {\n\tthis.logger.log('Writing .yeopress file');\n\tthis.fs.writeJSON(this.destinationPath('.yeopress'), this.conf.get(), null, '\\t');\n\n\t// just go ahead and write this one to disk so we don't get a\n\t// weird \"create .yeopress\" at termination\n\tthis.fs.commit(function (err) {\n\t\tif (err) this.logger.error(err);\n\n\t\tthis.logger.verbose('Done writing .yeopress file');\n\t}.bind(this));\n};\n\n// All done\nGenerator.prototype.oopsIPeedMyself = function() {\n\tthis.logger.log(chalk.bold.green('\\nAll Done!!\\n------------------------\\n'), {logPrefix: ''});\n\tthis.logger.log('I tried my best to set things up, but I\\'m only human right? **wink wink**\\nSo, you should probably check your `wp-config.php` to make sure all the settings work on your environment.', {logPrefix: ''});\n\tthis.logger.log('Have fun pressing your words!\\n', {logPrefix: ''});\n};\n"]}