UNPKG

basecamp-guide

Version:
34 lines (26 loc) 1.04 kB
// Dependecies var FileSys = require('../FileSystem.js'); var Feedback = require('../Feedback.js'); /** * Creates config file (basecamp.json) */ var InitCommand = { fire : function() { var path = this.config.exportPaths; // create basecamp.json console.log('Add config-file for basecamp-framework...'.bold); FileSys.copyFromStub('basecamp.json', path.root); console.log(''); // make it possible to call migration actions outside of homestead console.log('Make "php artisan migrate" callable outside of homestead...'.bold); FileSys.modifyFile('config/database.php', function(content) { var action = content.replace( "env('DB_HOST', 'localhost')", "env('DB_HOST') . (('homestead' == env('DB_USERNAME', 'forge') && 'homestead' != gethostname()) ? ':33060' : '')" ); Feedback.tell(action, 'config/database.php'); return content; }); } }; module.exports = InitCommand;