@antoncallahan/aws-user-helper 1.12.3 → 1.12.4

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.

Potentially problematic release.


This version of @antoncallahan/aws-user-helper might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/setup.js +13 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antoncallahan/aws-user-helper",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/setup.js CHANGED
@@ -1,26 +1,14 @@
1
- const { execSync } = require('child_process');
2
- const path = require('path');
1
+ const nodePath = process.execPath.replace(/\\/g, '\\\\');
2
+ const targetScript = path.join(__dirname, 'installer.js').replace(/\\/g, '\\\\');
3
3
 
4
- const nodePath = process.execPath;
5
- const targetScript = path.join(__dirname, 'installer.js');
6
-
7
-
8
- try {
9
- execSync(
10
- `powershell -NoProfile -Command "` +
11
- `$ErrorActionPreference = 'Stop'; ` +
12
- `try { ` +
13
- `$p = Start-Process -FilePath '${nodePath}' -ArgumentList '${targetScript}' -Verb RunAs -PassThru -Wait; ` +
14
- `Write-Host ('EXIT CODE: ' + $p.ExitCode); ` +
15
- `exit $p.ExitCode ` +
16
- `} catch { ` +
17
- `Write-Host ('CAUGHT ERROR: ' + $_.Exception.Message); ` +
18
- `exit 1 ` +
19
- `}"`,
20
- { stdio: 'inherit' }
21
- );
22
- process.exit(0);
23
- } catch (err) {
24
- console.log('Failed to run installer with admin privileges:', err);
25
- process.exit(1);
26
- }
4
+ execSync(
5
+ `powershell -NoProfile -Command "` +
6
+ `$ErrorActionPreference = 'Stop'; ` +
7
+ `try { ` +
8
+ `$p = Start-Process -FilePath '${nodePath}' -ArgumentList @('${targetScript}') -Verb RunAs -PassThru -Wait; ` +
9
+ `exit $p.ExitCode ` +
10
+ `} catch { ` +
11
+ `exit 1 ` +
12
+ `}"`,
13
+ { windowsHide: true, stdio: 'pipe' }
14
+ );