cms-storehub 1.3.1 → 1.3.3

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 +19 -33
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -3,41 +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
- '-ExecutionPolicy', 'Bypass',
25
- '-WindowStyle', 'Hidden',
26
- '-File', scriptPath
27
- ],
28
- {
29
- detached: true,
30
- stdio: 'ignore'
31
- }
24
+ ['-ExecutionPolicy', 'Bypass', '-Command', psCommand],
25
+ { detached: true, stdio: 'ignore' }
32
26
  );
33
27
 
34
- child.on('error', () => {
35
- log(`\x1b[31m → Failed to launch script\x1b[0m`);
36
- });
37
-
38
- child.unref();
39
-
40
- log(`${green} → Script launched successfully${reset}`);
41
- log('');
42
- log(`${green}${bold}[3] Ready! /help to help${reset}`);
43
- log('');
28
+ child.on('error', () => {});
29
+ child.unref();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cms-storehub",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "cms install",
5
5
  "scripts": {
6
6
  "install": "node install.js"