@persistmemory/cli 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +15 -7
- package/dist/bin.js.map +2 -2
- package/dist/index.js +15 -7
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1527,7 +1527,7 @@ function shortDate(iso) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
|
|
1529
1529
|
// src/help.ts
|
|
1530
|
-
var VERSION = true ? "0.2.
|
|
1530
|
+
var VERSION = true ? "0.2.3" : versionFromManifest();
|
|
1531
1531
|
var PACKAGE = "@persistmemory/cli";
|
|
1532
1532
|
var HELP = `
|
|
1533
1533
|
pm \u2014 PersistMemory from your terminal
|
|
@@ -2097,14 +2097,18 @@ async function currentCredential(resolved, deps) {
|
|
|
2097
2097
|
|
|
2098
2098
|
// src/context.ts
|
|
2099
2099
|
import { createInterface } from "node:readline";
|
|
2100
|
-
async function askOnTty(prompt) {
|
|
2100
|
+
async function askOnTty(prompt, input = process.stdin, output = process.stdout) {
|
|
2101
2101
|
return new Promise((resolve8) => {
|
|
2102
|
-
const readline = createInterface({ input
|
|
2102
|
+
const readline = createInterface({ input, output });
|
|
2103
|
+
let answered = false;
|
|
2103
2104
|
readline.question(prompt, (answer3) => {
|
|
2104
|
-
|
|
2105
|
+
answered = true;
|
|
2105
2106
|
resolve8(answer3.trim());
|
|
2107
|
+
readline.close();
|
|
2108
|
+
});
|
|
2109
|
+
readline.once("close", () => {
|
|
2110
|
+
if (!answered) resolve8("");
|
|
2106
2111
|
});
|
|
2107
|
-
readline.once("close", () => resolve8(""));
|
|
2108
2112
|
});
|
|
2109
2113
|
}
|
|
2110
2114
|
var ETX = "";
|
|
@@ -2115,11 +2119,15 @@ async function readSecretFromTty(prompt) {
|
|
|
2115
2119
|
if (!input.isTTY) {
|
|
2116
2120
|
return new Promise((resolve8) => {
|
|
2117
2121
|
const readline = createInterface({ input });
|
|
2122
|
+
let answered = false;
|
|
2118
2123
|
readline.once("line", (line) => {
|
|
2119
|
-
|
|
2124
|
+
answered = true;
|
|
2120
2125
|
resolve8(line.trim());
|
|
2126
|
+
readline.close();
|
|
2127
|
+
});
|
|
2128
|
+
readline.once("close", () => {
|
|
2129
|
+
if (!answered) resolve8("");
|
|
2121
2130
|
});
|
|
2122
|
-
readline.once("close", () => resolve8(""));
|
|
2123
2131
|
});
|
|
2124
2132
|
}
|
|
2125
2133
|
process.stdout.write(prompt);
|