kanon-cli 0.1.3 → 0.1.4
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/kanon.js +1 -1
- package/package.json +1 -1
- package/src/commands/dashboard.js +11 -2
package/bin/kanon.js
CHANGED
package/package.json
CHANGED
|
@@ -14,8 +14,17 @@ export async function dashboardCommand(options) {
|
|
|
14
14
|
|
|
15
15
|
// Open browser (Commander's --no-browser sets options.browser = false)
|
|
16
16
|
if (options.browser !== false) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const p = platform();
|
|
18
|
+
if (p === 'darwin') {
|
|
19
|
+
exec(`open ${url}`, () => {});
|
|
20
|
+
} else if (p === 'win32') {
|
|
21
|
+
exec(`start ${url}`, () => {});
|
|
22
|
+
} else {
|
|
23
|
+
// Linux / WSL2: try xdg-open, fall back to powershell.exe (WSL2 → Windows browser)
|
|
24
|
+
exec(`xdg-open ${url}`, (err) => {
|
|
25
|
+
if (err) exec(`powershell.exe -NoProfile -Command "Start-Process '${url}'"`, () => {});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
19
28
|
console.log(chalk.dim(`Opening ${url} in browser...`));
|
|
20
29
|
}
|
|
21
30
|
|