Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 75cf745

Browse files
committed
Formatting and Indentation
Changes to formatting and indentation.
1 parent 0560062 commit 75cf745

File tree

2 files changed

+148
-135
lines changed

2 files changed

+148
-135
lines changed

config/lib/seed.js

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ function checkUserNotExists (user) {
5656
function reportSuccess (password) {
5757
return function (user) {
5858
return new Promise(function (resolve, reject) {
59-
if (seedOptions.logResults) console.log(chalk.bold.red('Database Seeding:\t\t\tLocal ' + user.username + ' added with password set to ' + password));
59+
if (seedOptions.logResults) {
60+
console.log(chalk.bold.red('Database Seeding:\t\t\tLocal ' + user.username + ' added with password set to ' + password));
61+
}
6062
resolve();
6163
});
6264
};
@@ -73,24 +75,24 @@ function seedTheUser (user) {
7375

7476
if (user.username === seedOptions.seedAdmin.username && process.env.NODE_ENV === 'production') {
7577
checkUserNotExists(user)
76-
.then(saveUser(user))
77-
.then(reportSuccess(password))
78-
.then(function () {
79-
resolve();
80-
})
81-
.catch(function (err) {
82-
reject(err);
83-
});
78+
.then(saveUser(user))
79+
.then(reportSuccess(password))
80+
.then(function () {
81+
resolve();
82+
})
83+
.catch(function (err) {
84+
reject(err);
85+
});
8486
} else {
8587
removeUser(user)
86-
.then(saveUser(user))
87-
.then(reportSuccess(password))
88-
.then(function () {
89-
resolve();
90-
})
91-
.catch(function (err) {
92-
reject(err);
93-
});
88+
.then(saveUser(user))
89+
.then(reportSuccess(password))
90+
.then(function () {
91+
resolve();
92+
})
93+
.catch(function (err) {
94+
reject(err);
95+
});
9496
}
9597
});
9698
};
@@ -135,22 +137,22 @@ module.exports.start = function start(options) {
135137
//If production only seed admin if it does not exist
136138
if (process.env.NODE_ENV === 'production') {
137139
User.generateRandomPassphrase()
138-
.then(seedTheUser(adminAccount))
139-
.then(function () {
140+
.then(seedTheUser(adminAccount))
141+
.then(function () {
140142
resolve();
141143
})
142-
.catch(reportError(reject));
144+
.catch(reportError(reject));
143145
} else {
144146
// Add both Admin and User account
145147

146148
User.generateRandomPassphrase()
147-
.then(seedTheUser(userAccount))
148-
.then(User.generateRandomPassphrase)
149-
.then(seedTheUser(adminAccount))
150-
.then(function () {
149+
.then(seedTheUser(userAccount))
150+
.then(User.generateRandomPassphrase)
151+
.then(seedTheUser(adminAccount))
152+
.then(function () {
151153
resolve();
152154
})
153-
.catch(reportError(reject));
155+
.catch(reportError(reject));
154156
}
155157
});
156158
};

0 commit comments

Comments
 (0)