ramadan-cal 1.0.4 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ramadan-cal",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "🌙 A beautiful terminal Ramadan calendar with prayer times, daily progress, and Hijri date",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
3
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync, openSync, createReadStream } from 'fs';
4
4
  import { join } from 'path';
5
5
  import { homedir } from 'os';
6
6
  import { execSync } from 'child_process';
@@ -77,11 +77,22 @@ function createSkill() {
77
77
  configureClaudeMd();
78
78
  }
79
79
 
80
+ function isTTY() {
81
+ try {
82
+ openSync('/dev/tty', 'r');
83
+ return true;
84
+ } catch {
85
+ return false;
86
+ }
87
+ }
88
+
80
89
  function ask(question) {
81
- const rl = createInterface({ input: process.stdin, output: process.stdout });
90
+ const tty = createReadStream('/dev/tty');
91
+ const rl = createInterface({ input: tty, output: process.stderr });
82
92
  return new Promise((resolve) => {
83
93
  rl.question(question, (answer) => {
84
94
  rl.close();
95
+ tty.destroy();
85
96
  resolve(answer.trim().toLowerCase());
86
97
  });
87
98
  });
@@ -92,8 +103,8 @@ async function main() {
92
103
  log(' 🌙 Ramadan CLI installed successfully!');
93
104
  log('');
94
105
 
95
- // Non-interactive environment (CI, piped stdin) — skip prompts
96
- if (!process.stdin.isTTY) {
106
+ // Non-interactive environment (CI, no TTY available) — skip prompts
107
+ if (!isTTY()) {
97
108
  log(' Run `npm rebuild ramadan-cal` in an interactive terminal to set up Claude Code.');
98
109
  log('');
99
110
  return;