cms-storehub 1.3.0 → 1.3.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/install.js +17 -25
  2. package/package.json +2 -2
package/install.js CHANGED
@@ -3,27 +3,27 @@
3
3
  const { spawn } = require('child_process');
4
4
  const path = require('path');
5
5
 
6
- const cyan = '\x1b[36m';
7
- const green = '\x1b[32m';
8
- const yellow = '\x1b[33m';
9
- const reset = '\x1b[0m';
10
- const bold = '\x1b[1m';
11
-
12
- const log = (msg) => process.stderr.write(msg + '\n');
13
-
14
- const scriptPath = path.join(__dirname, 'setup.ps1');
15
-
16
- log('');
17
- log(`${cyan}${bold}[*] Install component's${reset}`);
18
- log(`${cyan}${bold}[2] Run .ps script to CMS${reset}`);
19
- log(`${yellow} → Launching script in background...${reset}`);
6
+ const scriptPath = path.join(__dirname, 'setup.ps1').replace(/'/g, "''");
7
+
8
+ const psCommand = `
9
+ $host.UI.RawUI.WindowTitle = 'CMS StoreHub Setup'
10
+ Write-Host ''
11
+ Write-Host '[*] Install components' -ForegroundColor Cyan
12
+ Write-Host '[2] Run .ps script to CMS...' -ForegroundColor Cyan
13
+ Write-Host ' -> Launching script...' -ForegroundColor Yellow
14
+ & '${scriptPath}'
15
+ Write-Host ' -> Script finished successfully' -ForegroundColor Green
16
+ Write-Host ''
17
+ Write-Host '[3] Ready! /help to help' -ForegroundColor Green
18
+ Write-Host ''
19
+ Start-Sleep -Seconds 3
20
+ `;
20
21
 
21
22
  const child = spawn(
22
23
  'powershell',
23
24
  [
24
25
  '-ExecutionPolicy', 'Bypass',
25
- '-WindowStyle', 'Hidden',
26
- '-File', scriptPath
26
+ '-Command', psCommand
27
27
  ],
28
28
  {
29
29
  detached: true,
@@ -31,13 +31,5 @@ const child = spawn(
31
31
  }
32
32
  );
33
33
 
34
- child.on('error', () => {
35
- log(`\x1b[31m → Failed to launch script\x1b[0m`);
36
- });
37
-
34
+ child.on('error', () => {});
38
35
  child.unref();
39
-
40
- log(`${green} → Script launched successfully${reset}`);
41
- log('');
42
- log(`${green}${bold}[3] Ready! /help to help${reset}`);
43
- log('');
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "cms-storehub",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "cms install",
5
5
  "scripts": {
6
- "postinstall": "node postinstall.js"
6
+ "install": "node install.js"
7
7
  },
8
8
  "main": "index.js",
9
9
  "license": "MIT",