jira-report-tui 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/cli.js +44 -0
  2. package/package.json +2 -3
package/cli.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ function getPlatform() {
8
+ const type = process.platform;
9
+ const arch = process.arch;
10
+
11
+ if (type === 'win32') {
12
+ return arch === 'x64' ? 'windows-amd64' : 'windows-arm64';
13
+ }
14
+ if (type === 'darwin') {
15
+ return arch === 'x64' ? 'darwin-amd64' : 'darwin-arm64';
16
+ }
17
+ if (type === 'linux') {
18
+ return arch === 'x64' ? 'linux-amd64' : 'linux-arm64';
19
+ }
20
+
21
+ console.error(`Unsupported platform: ${type} ${arch}`);
22
+ process.exit(1);
23
+ }
24
+
25
+ const platform = getPlatform();
26
+ const binDir = path.join(__dirname, 'bin');
27
+ const ext = process.platform === 'win32' ? '.exe' : '';
28
+ const binaryPath = path.join(binDir, `jira-report-${platform}${ext}`);
29
+
30
+ if (!fs.existsSync(binaryPath)) {
31
+ console.error(`Binary not found for ${platform}: ${binaryPath}`);
32
+ console.error('Please report this issue at: https://github.com/voxuanthuan/daily-report/issues');
33
+ process.exit(1);
34
+ }
35
+
36
+ // Execute the binary
37
+ const child = spawn(binaryPath, process.argv.slice(2), {
38
+ stdio: 'inherit',
39
+ env: process.env
40
+ });
41
+
42
+ child.on('exit', (code) => {
43
+ process.exit(code);
44
+ });
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "jira-report-tui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Fast, performant terminal interface for managing Jira tasks and logging time to Tempo - 20x faster than TypeScript version",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "jira-report": "bin/jira-report"
7
+ "jira-report": "cli.js"
8
8
  },
9
9
  "scripts": {
10
- "postinstall": "node install.js",
11
10
  "build": "./build-all.sh",
12
11
  "test": "echo \"Error: no test specified\" && exit 1"
13
12
  },