|
7 | 7 | * Copyright (c) 2022 ccagml . All rights reserved.
|
8 | 8 | */
|
9 | 9 |
|
10 |
| -import { storageUtils } from "./storageUtils"; |
| 10 | +// import { storageUtils } from "./storageUtils"; |
11 | 11 |
|
12 | 12 | class CommUtils {
|
13 | 13 | KEYS;
|
@@ -36,30 +36,30 @@ class CommUtils {
|
36 | 36 | }
|
37 | 37 | }
|
38 | 38 |
|
39 |
| - readStdin(cb) { |
40 |
| - const stdin = process.stdin; |
41 |
| - let bufs: Array<any> = []; |
| 39 | + // readStdin(cb) { |
| 40 | + // const stdin = process.stdin; |
| 41 | + // let bufs: Array<any> = []; |
42 | 42 |
|
43 |
| - console.log( |
44 |
| - "NOTE: to finish the input, press " + (storageUtils.isWindows() ? "<Ctrl-D> and <Return>" : "<Ctrl-D>") |
45 |
| - ); |
| 43 | + // console.log( |
| 44 | + // "NOTE: to finish the input, press " + (storageUtils.isWindows() ? "<Ctrl-D> and <Return>" : "<Ctrl-D>") |
| 45 | + // ); |
46 | 46 |
|
47 |
| - stdin.on("readable", function () { |
48 |
| - const data = stdin.read(); |
49 |
| - if (data) { |
50 |
| - // windows doesn't treat ctrl-D as EOF |
51 |
| - if (storageUtils.isWindows() && data.toString() === "\x04\r\n") { |
52 |
| - stdin.emit("end"); |
53 |
| - } else { |
54 |
| - bufs.push(data); |
55 |
| - } |
56 |
| - } |
57 |
| - }); |
58 |
| - stdin.on("end", function () { |
59 |
| - cb(null, Buffer.concat(bufs).toString()); |
60 |
| - }); |
61 |
| - stdin.on("error", cb); |
62 |
| - } |
| 47 | + // stdin.on("readable", function () { |
| 48 | + // const data = stdin.read(); |
| 49 | + // if (data) { |
| 50 | + // // windows doesn't treat ctrl-D as EOF |
| 51 | + // if (storageUtils.isWindows() && data.toString() === "\x04\r\n") { |
| 52 | + // stdin.emit("end"); |
| 53 | + // } else { |
| 54 | + // bufs.push(data); |
| 55 | + // } |
| 56 | + // } |
| 57 | + // }); |
| 58 | + // stdin.on("end", function () { |
| 59 | + // cb(null, Buffer.concat(bufs).toString()); |
| 60 | + // }); |
| 61 | + // stdin.on("error", cb); |
| 62 | + // } |
63 | 63 |
|
64 | 64 | getSetCookieValue(resp: any, key: any) {
|
65 | 65 | const cookies = resp.headers["set-cookie"];
|
|
0 commit comments