alurkerja-cli 1.0.9 → 1.0.11

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/index.js CHANGED
@@ -17,8 +17,7 @@ const GITLAB_BASE = 'https://gitlab.javan.co.id/alurkerja/on-premises/toolkits/a
17
17
  const GITLAB_TOKEN = 'javan-_P_JrtswtvrZekJDk1Lt'; // GitLab private token
18
18
  const VERSION = 'v1.0.0'; // Will be replaced during build
19
19
  const INSTALL_DIR = path.join(os.homedir(), '.alurkerja', 'bin');
20
- const BINARY_NAME = os.platform() === 'win32' ? 'alurkerja.exe' : 'alurkerja';
21
- const BINARY_PATH = path.join(INSTALL_DIR, BINARY_NAME);
20
+ const BINARY_PATH = path.join(INSTALL_DIR, 'alurkerja');
22
21
 
23
22
  /**
24
23
  * Detect current platform
@@ -201,40 +200,19 @@ function getInstalledVersion() {
201
200
  * Execute the Go binary with provided arguments
202
201
  */
203
202
  function executeBinary(args) {
204
- const isWindows = os.platform() === 'win32';
203
+ const child = spawn(BINARY_PATH, args, {
204
+ stdio: 'inherit',
205
+ shell: false
206
+ });
205
207
 
206
- // On Windows with shell mode, properly quote the binary path to handle spaces
207
- if (isWindows) {
208
- const quotedPath = `"${BINARY_PATH}"`;
209
- const child = spawn(quotedPath, args, {
210
- stdio: 'inherit',
211
- shell: true
212
- });
213
-
214
- child.on('error', (err) => {
215
- console.error(`❌ Failed to execute binary: ${err.message}`);
216
- process.exit(1);
217
- });
218
-
219
- child.on('exit', (code) => {
220
- process.exit(code || 0);
221
- });
222
- } else {
223
- // Unix systems don't need quoting
224
- const child = spawn(BINARY_PATH, args, {
225
- stdio: 'inherit',
226
- shell: false
227
- });
228
-
229
- child.on('error', (err) => {
230
- console.error(`❌ Failed to execute binary: ${err.message}`);
231
- process.exit(1);
232
- });
233
-
234
- child.on('exit', (code) => {
235
- process.exit(code || 0);
236
- });
237
- }
208
+ child.on('error', (err) => {
209
+ console.error(`❌ Failed to execute binary: ${err.message}`);
210
+ process.exit(1);
211
+ });
212
+
213
+ child.on('exit', (code) => {
214
+ process.exit(code || 0);
215
+ });
238
216
  }
239
217
 
240
218
  /**
package/index.js.backup CHANGED
@@ -17,8 +17,7 @@ const GITLAB_BASE = 'https://gitlab.javan.co.id/alurkerja/on-premises/toolkits/a
17
17
  const GITLAB_TOKEN = 'javan-_P_JrtswtvrZekJDk1Lt'; // GitLab private token
18
18
  const VERSION = 'v1.0.0'; // Will be replaced during build
19
19
  const INSTALL_DIR = path.join(os.homedir(), '.alurkerja', 'bin');
20
- const BINARY_NAME = os.platform() === 'win32' ? 'alurkerja.exe' : 'alurkerja';
21
- const BINARY_PATH = path.join(INSTALL_DIR, BINARY_NAME);
20
+ const BINARY_PATH = path.join(INSTALL_DIR, 'alurkerja');
22
21
 
23
22
  /**
24
23
  * Detect current platform
@@ -201,40 +200,19 @@ function getInstalledVersion() {
201
200
  * Execute the Go binary with provided arguments
202
201
  */
203
202
  function executeBinary(args) {
204
- const isWindows = os.platform() === 'win32';
203
+ const child = spawn(BINARY_PATH, args, {
204
+ stdio: 'inherit',
205
+ shell: false
206
+ });
205
207
 
206
- // On Windows with shell mode, properly quote the binary path to handle spaces
207
- if (isWindows) {
208
- const quotedPath = `"${BINARY_PATH}"`;
209
- const child = spawn(quotedPath, args, {
210
- stdio: 'inherit',
211
- shell: true
212
- });
213
-
214
- child.on('error', (err) => {
215
- console.error(`❌ Failed to execute binary: ${err.message}`);
216
- process.exit(1);
217
- });
218
-
219
- child.on('exit', (code) => {
220
- process.exit(code || 0);
221
- });
222
- } else {
223
- // Unix systems don't need quoting
224
- const child = spawn(BINARY_PATH, args, {
225
- stdio: 'inherit',
226
- shell: false
227
- });
228
-
229
- child.on('error', (err) => {
230
- console.error(`❌ Failed to execute binary: ${err.message}`);
231
- process.exit(1);
232
- });
233
-
234
- child.on('exit', (code) => {
235
- process.exit(code || 0);
236
- });
237
- }
208
+ child.on('error', (err) => {
209
+ console.error(`❌ Failed to execute binary: ${err.message}`);
210
+ process.exit(1);
211
+ });
212
+
213
+ child.on('exit', (code) => {
214
+ process.exit(code || 0);
215
+ });
238
216
  }
239
217
 
240
218
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alurkerja-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Alurkerja CLI - npx wrapper for Go binary",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alurkerja-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Alurkerja CLI - npx wrapper for Go binary",
5
5
  "main": "index.js",
6
6
  "private": false,