underpost 2.7.2 → 2.7.5

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/bin/shortcut.js DELETED
@@ -1,44 +0,0 @@
1
- import fs from 'fs';
2
- import { getRootDirectory, shellExec } from '../src/server/process.js';
3
- import os from 'os';
4
-
5
- const [exe, dir, oS, env] = process.argv;
6
-
7
- switch (oS) {
8
- case 'windows':
9
- switch (env) {
10
- case 'development':
11
- (() => {
12
- const desktopDir = `${os.homedir()}/desktop`.replaceAll('\\', '/');
13
- fs.writeFileSync(
14
- `./bin/shortcut.ps1`,
15
- `
16
- $DesktopPath = [Environment]::GetFolderPath("Desktop") + "/${env}-engine.lnk"
17
-
18
- $WshShell = New-Object -comObject WScript.Shell
19
-
20
- $Shortcut = $WshShell.CreateShortcut($DesktopPath)
21
-
22
- $Shortcut.TargetPath = "cmd.exe"
23
-
24
- $Shortcut.Arguments = "PowerShell Start-Process cmd -Verb RunAs -ArgumentList '/k cd ${getRootDirectory()} && npm run dev"
25
-
26
- $Shortcut.IconLocation = "${getRootDirectory()}/src/client/public/doc/favicon.ico"
27
-
28
- $Shortcut.Save()
29
- `,
30
- );
31
- shellExec(`PowerShell bin/shortcut.ps1`);
32
- fs.unlinkSync(`./bin/shortcut.ps1`);
33
- })();
34
- break;
35
-
36
- default:
37
- break;
38
- }
39
-
40
- break;
41
-
42
- default:
43
- break;
44
- }