Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3508609
D11258.id38035.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11258.id38035.diff
View Options
diff --git a/scripts/set-user-credentials.js b/scripts/set-user-credentials.js
--- a/scripts/set-user-credentials.js
+++ b/scripts/set-user-credentials.js
@@ -4,11 +4,23 @@
const fs = require('fs');
const readline = require('readline');
+const Writable = require('stream').Writable;
+
+let silenceOutput = false;
+
+const outStream = new Writable({
+ write: function (chunk, encoding, callback) {
+ if (!silenceOutput) {
+ process.stdout.write(chunk, encoding);
+ }
+ callback();
+ },
+});
-// Create an interface for reading input
const rl = readline.createInterface({
input: process.stdin,
- output: process.stdout,
+ output: outStream,
+ terminal: true,
});
const data = {};
@@ -17,13 +29,17 @@
data.username = value1;
rl.question('password: ', value2 => {
- data.password = value2;
+ silenceOutput = false;
+ rl.output.write('\n');
+ data.password = value2;
writeFiles(data);
// Close the readline interface
rl.close();
});
+
+ silenceOutput = true;
});
function writeFiles(credentials) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 11:04 PM (5 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2689817
Default Alt Text
D11258.id38035.diff (1 KB)
Attached To
Mode
D11258: [scripts] Hide password
Attached
Detach File
Event Timeline
Log In to Comment