@artilingo/artiframe-cli 3.0.0 → 3.0.1
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/package.json +1 -1
- package/scripts/postinstall.js +48 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artilingo/artiframe-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "ArtiFrame — Zero-dependency native PHP framework with a powerful multilingual CLI. Scaffold projects, generate views, APIs and classes instantly.",
|
|
5
5
|
"main": "bin/artiframe.js",
|
|
6
6
|
"bin": {
|
package/scripts/postinstall.js
CHANGED
|
@@ -55,3 +55,51 @@ const { execSync } = require('child_process');
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
+
|
|
59
|
+
// 4. Create Desktop Shortcuts for GUI
|
|
60
|
+
try {
|
|
61
|
+
if (process.platform === 'linux') {
|
|
62
|
+
const appDir = path.join(os.homedir(), '.local', 'share', 'applications');
|
|
63
|
+
if (fs.existsSync(appDir)) {
|
|
64
|
+
const desktopFile = path.join(appDir, 'artiframe-devops.desktop');
|
|
65
|
+
const content = `[Desktop Entry]
|
|
66
|
+
Name=ArtiFrame DevOps
|
|
67
|
+
Comment=Launch ArtiFrame DevOps Studio
|
|
68
|
+
Exec=artiframe devops
|
|
69
|
+
Icon=utilities-terminal
|
|
70
|
+
Terminal=false
|
|
71
|
+
Type=Application
|
|
72
|
+
Categories=Development;
|
|
73
|
+
`;
|
|
74
|
+
fs.writeFileSync(desktopFile, content);
|
|
75
|
+
fs.chmodSync(desktopFile, 0o755);
|
|
76
|
+
console.log('\x1b[36m%s\x1b[0m', '✅ Application menu shortcut created (Linux).');
|
|
77
|
+
}
|
|
78
|
+
} else if (process.platform === 'win32') {
|
|
79
|
+
const { execSync } = require('child_process');
|
|
80
|
+
|
|
81
|
+
// Create a silent VBS runner in Workspace to prevent CMD window pop-up
|
|
82
|
+
const runnerVbs = path.join(defaultWorkspace, 'run-devops.vbs');
|
|
83
|
+
const runnerCode = `Set WshShell = CreateObject("WScript.Shell")\nWshShell.Run "cmd.exe /c artiframe devops", 0, False`;
|
|
84
|
+
fs.writeFileSync(runnerVbs, runnerCode);
|
|
85
|
+
|
|
86
|
+
// Generate the .lnk shortcut on the Desktop pointing to the silent runner
|
|
87
|
+
const desktopPath = path.join(os.homedir(), 'Desktop', 'ArtiFrame DevOps.lnk');
|
|
88
|
+
const vbsPath = path.join(os.tmpdir(), 'create_shortcut.vbs');
|
|
89
|
+
|
|
90
|
+
const vbsCode = `
|
|
91
|
+
Set ws = WScript.CreateObject("WScript.Shell")
|
|
92
|
+
Set link = ws.CreateShortcut("${desktopPath}")
|
|
93
|
+
link.TargetPath = "wscript.exe"
|
|
94
|
+
link.Arguments = """${runnerVbs}"""
|
|
95
|
+
link.Description = "ArtiFrame DevOps Studio"
|
|
96
|
+
link.IconLocation = "%SystemRoot%\\System32\\SHELL32.dll,27"
|
|
97
|
+
link.Save
|
|
98
|
+
`;
|
|
99
|
+
fs.writeFileSync(vbsPath, vbsCode);
|
|
100
|
+
execSync(`cscript //nologo "${vbsPath}"`);
|
|
101
|
+
console.log('\x1b[36m%s\x1b[0m', '✅ Desktop shortcut created (Windows).');
|
|
102
|
+
}
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.log('\x1b[33m%s\x1b[0m', '⚠️ Could not create desktop shortcut. You can still run via terminal.');
|
|
105
|
+
}
|