@lvnt/release-radar-cli 0.2.0 → 0.2.1

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
@@ -40,14 +40,17 @@ async function runConfig() {
40
40
  async function runInteractive() {
41
41
  const configManager = new ConfigManager();
42
42
  const tracker = new DownloadTracker();
43
+ // Check for updates first (before any prompts) unless --skip-update is passed
44
+ const skipUpdate = process.argv.includes('--skip-update');
45
+ if (!skipUpdate) {
46
+ await checkAndUpdate();
47
+ }
43
48
  // First run setup
44
49
  if (!configManager.isConfigured()) {
45
50
  const config = await promptSetup();
46
51
  configManager.save(config);
47
52
  console.log(chalk.green('\nConfiguration saved!\n'));
48
53
  }
49
- // Check for updates and restart if needed
50
- await checkAndUpdate();
51
54
  // Load data
52
55
  const config = configManager.load();
53
56
  const versions = loadVersions();
@@ -87,7 +90,8 @@ async function runInteractive() {
87
90
  console.log(chalk.green('Done!'));
88
91
  }
89
92
  async function main() {
90
- const command = process.argv[2];
93
+ const args = process.argv.slice(2).filter(arg => !arg.startsWith('--'));
94
+ const command = args[0];
91
95
  switch (command) {
92
96
  case 'status':
93
97
  await showStatus();
@@ -96,6 +100,11 @@ async function main() {
96
100
  await runConfig();
97
101
  break;
98
102
  default:
103
+ // Check if stdin is a TTY for interactive mode
104
+ if (!process.stdin.isTTY) {
105
+ console.error(chalk.red('Error: Interactive mode requires a TTY. Use "status" command for non-interactive use.'));
106
+ process.exit(1);
107
+ }
99
108
  await runInteractive();
100
109
  break;
101
110
  }
package/dist/updater.js CHANGED
@@ -13,6 +13,7 @@ function getLatestVersion() {
13
13
  const result = execSync('npm view @lvnt/release-radar-cli version', {
14
14
  encoding: 'utf-8',
15
15
  stdio: ['pipe', 'pipe', 'pipe'],
16
+ timeout: 10000, // 10 second timeout
16
17
  });
17
18
  return result.trim();
18
19
  }
@@ -32,11 +33,15 @@ export async function checkAndUpdate() {
32
33
  }
33
34
  console.log(`Updating from ${current} to ${latest}...`);
34
35
  try {
35
- execSync('npm update -g @lvnt/release-radar-cli', {
36
- stdio: 'inherit',
36
+ // Use pipe instead of inherit to avoid messing with terminal state
37
+ const result = execSync('npm update -g @lvnt/release-radar-cli', {
38
+ encoding: 'utf-8',
39
+ stdio: ['pipe', 'pipe', 'pipe'],
37
40
  });
41
+ if (result)
42
+ console.log(result);
38
43
  console.log('Update complete. Restarting...\n');
39
- // Restart self
44
+ // Restart self with a fresh terminal
40
45
  const child = spawn(process.argv[0], process.argv.slice(1), {
41
46
  detached: true,
42
47
  stdio: 'inherit',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Interactive CLI for downloading tools through Nexus proxy",
5
5
  "main": "dist/index.js",
6
6
  "bin": {