mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
Use console.log instead of process.stdout.write (#6123)
* Use console.log instead of process.stdout.write * Don't break the installer
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
15c8693a23
commit
dbdc05404d
@@ -174,7 +174,7 @@ function completeConfigSetup(config, next) {
|
||||
}
|
||||
|
||||
function setupDefaultConfigs(next) {
|
||||
process.stdout.write('Populating database with default configs, if not already set...\n');
|
||||
console.log('Populating database with default configs, if not already set...');
|
||||
var meta = require('./meta');
|
||||
var defaults = require(path.join(__dirname, '../', 'install/data/defaults.json'));
|
||||
|
||||
@@ -192,11 +192,11 @@ function enableDefaultTheme(next) {
|
||||
|
||||
meta.configs.get('theme:id', function (err, id) {
|
||||
if (err || id) {
|
||||
process.stdout.write('Previous theme detected, skipping enabling default theme\n');
|
||||
console.log('Previous theme detected, skipping enabling default theme');
|
||||
return next(err);
|
||||
}
|
||||
var defaultTheme = nconf.get('defaultTheme') || 'nodebb-theme-persona';
|
||||
process.stdout.write('Enabling default theme: ' + defaultTheme + '\n');
|
||||
console.log('Enabling default theme: ' + defaultTheme);
|
||||
meta.themes.set({
|
||||
type: 'local',
|
||||
id: defaultTheme,
|
||||
@@ -211,7 +211,7 @@ function createAdministrator(next) {
|
||||
return next(err);
|
||||
}
|
||||
if (memberCount > 0) {
|
||||
process.stdout.write('Administrator found, skipping Admin setup\n');
|
||||
console.log('Administrator found, skipping Admin setup');
|
||||
next();
|
||||
} else {
|
||||
createAdmin(next);
|
||||
@@ -315,7 +315,7 @@ function createAdmin(callback) {
|
||||
} else {
|
||||
// If automated setup did not provide a user password, generate one, it will be shown to the user upon setup completion
|
||||
if (!install.values.hasOwnProperty('admin:password') && !nconf.get('admin:password')) {
|
||||
process.stdout.write('Password was not provided during automated setup, generating one...\n');
|
||||
console.log('Password was not provided during automated setup, generating one...');
|
||||
password = utils.generateUUID().slice(0, 8);
|
||||
}
|
||||
|
||||
@@ -365,11 +365,11 @@ function createCategories(next) {
|
||||
}
|
||||
|
||||
if (Array.isArray(categoryData) && categoryData.length) {
|
||||
process.stdout.write('Categories OK. Found ' + categoryData.length + ' categories.\n');
|
||||
console.log('Categories OK. Found ' + categoryData.length + ' categories.');
|
||||
return next();
|
||||
}
|
||||
|
||||
process.stdout.write('No categories found, populating instance with default categories\n');
|
||||
console.log('No categories found, populating instance with default categories');
|
||||
|
||||
fs.readFile(path.join(__dirname, '../', 'install/data/categories.json'), 'utf8', function (err, default_categories) {
|
||||
if (err) {
|
||||
@@ -416,7 +416,7 @@ function createWelcomePost(next) {
|
||||
var numTopics = results[1];
|
||||
|
||||
if (!parseInt(numTopics, 10)) {
|
||||
process.stdout.write('Creating welcome post!\n');
|
||||
console.log('Creating welcome post!');
|
||||
Topics.post({
|
||||
uid: 1,
|
||||
cid: 2,
|
||||
@@ -430,7 +430,7 @@ function createWelcomePost(next) {
|
||||
}
|
||||
|
||||
function enableDefaultPlugins(next) {
|
||||
process.stdout.write('Enabling default plugins\n');
|
||||
console.log('Enabling default plugins');
|
||||
|
||||
var defaultEnabled = [
|
||||
'nodebb-plugin-composer-default',
|
||||
@@ -546,7 +546,7 @@ install.save = function (server_conf, callback) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
process.stdout.write('Configuration Saved OK\n');
|
||||
console.log('Configuration Saved OK');
|
||||
|
||||
nconf.file({
|
||||
file: path.join(__dirname, '..', 'config.json'),
|
||||
|
||||
Reference in New Issue
Block a user