fix bug stdin pipe to wrong process
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
//@ts-check
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* @returns { Promise<string> }
|
||||
*/
|
||||
async function getline(str) {
|
||||
process.stdout.write(str)
|
||||
process.stdin.resume();
|
||||
process.stdin.resume()
|
||||
process.stdin.setEncoding('utf8')
|
||||
let line = ""
|
||||
return new Promise((res, rej) => {
|
||||
@@ -19,7 +25,7 @@ async function getline(str) {
|
||||
}
|
||||
|
||||
function isAlpha(str){
|
||||
return /^[a-zA-Z]*$/.test(str);
|
||||
return /^[a-zA-Z]*$/.test(str)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user