bit-office 0.1.3 → 0.1.5

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/index.js CHANGED
@@ -4956,11 +4956,26 @@ var telegramChannel = {
4956
4956
  import { createInterface } from "readline";
4957
4957
  function ask(rl, question) {
4958
4958
  return new Promise((resolve2) => {
4959
- rl.question(question, (answer) => resolve2(answer.trim()));
4959
+ const onClose = () => resolve2("");
4960
+ rl.once("close", onClose);
4961
+ rl.question(question, (answer) => {
4962
+ rl.removeListener("close", onClose);
4963
+ resolve2(answer.trim());
4964
+ });
4960
4965
  });
4961
4966
  }
4962
4967
  async function runSetup() {
4963
- const rl = createInterface({ input: process.stdin, output: process.stdout });
4968
+ if (!process.stdin.isTTY) {
4969
+ saveConfig({});
4970
+ console.log("\u2713 Default config saved to ~/.bit-office/config.json");
4971
+ console.log(" Run with --setup in a terminal to configure.\n");
4972
+ return;
4973
+ }
4974
+ const rl = createInterface({
4975
+ input: process.stdin,
4976
+ output: process.stdout,
4977
+ terminal: true
4978
+ });
4964
4979
  console.log("");
4965
4980
  console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
4966
4981
  console.log("\u2551 Bit Office \u2014 First Setup \u2551");