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.
- package/install.js +19 -33
- 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
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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();
|