Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 0379a2e

Browse files
committed
Fix linting problems in portal code
1 parent 4016d5c commit 0379a2e

File tree

15 files changed

+1877
-1555
lines changed

15 files changed

+1877
-1555
lines changed

scripts/release/initauth.js

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const fs = require('fs');
99
const cipher = require('./cipher');
1010
const authStore = path.resolve(__dirname, cipher.astore);
1111
const authBase = path.basename(path.dirname(authStore));
12-
const { Writable } = require('stream');
12+
const {Writable} = require('stream');
1313

1414
const mutableStdout = new Writable({
1515
write(chunk, encoding, callback) {
@@ -61,65 +61,65 @@ const saveAuth = (obj, filename) => new Promise((resolve, reject) => {
6161

6262
const updateRabbit = () => new Promise((resolve, reject) => {
6363
question('Update RabbitMQ account?[yes/no]')
64-
.then((answer) => {
65-
answer = answer.toLowerCase();
66-
if (answer !== 'y' && answer !== 'yes') {
67-
resolve();
68-
return;
69-
}
70-
question(`(${authBase}) Enter username of rabbitmq: `)
71-
.then((username) => {
72-
question(`(${authBase}) Enter password of rabbitmq: `)
73-
.then((password) => {
74-
mutableStdout.muted = false;
75-
saveAuth({ rabbit: { username, password } }, authStore)
76-
.then(resolve)
77-
.catch(reject);
64+
.then((answer) => {
65+
answer = answer.toLowerCase();
66+
if (answer !== 'y' && answer !== 'yes') {
67+
resolve();
68+
return;
69+
}
70+
question(`(${authBase}) Enter username of rabbitmq: `)
71+
.then((username) => {
72+
question(`(${authBase}) Enter password of rabbitmq: `)
73+
.then((password) => {
74+
mutableStdout.muted = false;
75+
saveAuth({rabbit: {username, password}}, authStore)
76+
.then(resolve)
77+
.catch(reject);
78+
});
79+
mutableStdout.muted = true;
7880
});
79-
mutableStdout.muted = true;
80-
});
81-
});
81+
});
8282
});
8383

8484
const updateMongo = () => new Promise((resolve, reject) => {
8585
question('Update MongoDB account?[yes/no]')
86-
.then((answer) => {
87-
answer = answer.toLowerCase();
88-
if (answer !== 'y' && answer !== 'yes') {
89-
resolve();
90-
return;
91-
}
92-
question(`(${authBase}) Enter username of mongodb: `)
93-
.then((username) => {
94-
question(`(${authBase}) Enter password of mongodb: `)
95-
.then((password) => {
96-
mutableStdout.muted = false;
97-
saveAuth({ mongo: { username, password } }, authStore)
98-
.then(resolve)
99-
.catch(reject);
86+
.then((answer) => {
87+
answer = answer.toLowerCase();
88+
if (answer !== 'y' && answer !== 'yes') {
89+
resolve();
90+
return;
91+
}
92+
question(`(${authBase}) Enter username of mongodb: `)
93+
.then((username) => {
94+
question(`(${authBase}) Enter password of mongodb: `)
95+
.then((password) => {
96+
mutableStdout.muted = false;
97+
saveAuth({mongo: {username, password}}, authStore)
98+
.then(resolve)
99+
.catch(reject);
100+
});
101+
mutableStdout.muted = true;
100102
});
101-
mutableStdout.muted = true;
102-
});
103-
});
103+
});
104104
});
105105

106106
const updateInternal = () => new Promise((resolve, reject) => {
107107
question('Update internal passphrase?[yes/no]')
108-
.then((answer) => {
109-
answer = answer.toLowerCase();
110-
if (answer !== 'y' && answer !== 'yes') {
111-
resolve();
112-
return;
113-
}
114-
question(`(${authBase}) Enter internal passphrase: `)
115-
.then((passphrase) => {
116-
mutableStdout.muted = false;
117-
saveAuth({ internalPass: passphrase }, authStore)
118-
.then(resolve)
119-
.catch(reject);
120-
});
121-
mutableStdout.muted = true;
122-
});
108+
.then((answer) => {
109+
answer = answer.toLowerCase();
110+
if (answer !== 'y' && answer !== 'yes') {
111+
resolve();
112+
return;
113+
}
114+
question(`(${authBase}) Enter internal passphrase: `)
115+
.then((passphrase) => {
116+
mutableStdout.muted = false;
117+
saveAuth({internalPass: passphrase}, authStore)
118+
.then(resolve)
119+
.catch(reject);
120+
});
121+
mutableStdout.muted = true;
122+
});
123123
});
124124

125125
const options = {};
@@ -138,22 +138,22 @@ const parseArgs = () => {
138138
options.mongo = true;
139139
}
140140
return Promise.resolve();
141-
}
141+
};
142142

143143
parseArgs()
144-
.then(() => {
145-
if (options.rabbit) {
146-
return updateRabbit();
147-
}
148-
})
149-
.then(() => {
150-
if (options.mongo) {
151-
return updateMongo();
152-
}
153-
})
154-
.then(() => {
155-
if (options.internal) {
156-
return updateInternal();
157-
}
158-
})
159-
.finally(() => readline.close());
144+
.then(() => {
145+
if (options.rabbit) {
146+
return updateRabbit();
147+
}
148+
})
149+
.then(() => {
150+
if (options.mongo) {
151+
return updateMongo();
152+
}
153+
})
154+
.then(() => {
155+
if (options.internal) {
156+
return updateInternal();
157+
}
158+
})
159+
.finally(() => readline.close());

scripts/release/initcert.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
// SPDX-License-Identifier: Apache-2.0
55
'use strict';
66

7-
(function () {
8-
var readline = require('readline').createInterface({
7+
(function() {
8+
const readline = require('readline').createInterface({
99
input: process.stdin,
10-
output: process.stdout
10+
output: process.stdout,
1111
});
12-
var cipher = require('./cipher');
13-
var dirName = !process.pkg ? __dirname : require('path').dirname(process.execPath);
14-
var keystore = require('path').resolve(dirName, 'cert/' + cipher.kstore);
15-
readline.question('Enter passphrase of certificate: ', function (res) {
12+
const cipher = require('./cipher');
13+
const dirName =
14+
!process.pkg ? __dirname : require('path').dirname(process.execPath);
15+
const keystore = require('path').resolve(dirName, 'cert/' + cipher.kstore);
16+
readline.question('Enter passphrase of certificate: ', function(res) {
1617
readline.close();
17-
cipher.lock(cipher.k, res, keystore, function cb (err) {
18+
cipher.lock(cipher.k, res, keystore, function cb(err) {
1819
console.log(err||'done!');
1920
});
2021
});

0 commit comments

Comments
 (0)