collabdocchat 1.2.3 → 1.2.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.
Files changed (2) hide show
  1. package/bin/cli.js +18 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -14,10 +14,24 @@ const isWindows = platform() === 'win32';
14
14
 
15
15
  // 打开浏览器
16
16
  function openBrowser(url) {
17
- const command = isWindows ? 'cmd' : (platform() === 'darwin' ? 'open' : 'xdg-open');
18
- const args = isWindows ? ['/c', 'start', url] : [url];
19
- const browser = spawn(command, args, { stdio: 'ignore', detached: true });
20
- browser.unref();
17
+ try {
18
+ if (isWindows) {
19
+ // Windows: 使用 start 命令,需要添加空标题
20
+ spawn('cmd', ['/c', 'start', '""', url], {
21
+ stdio: 'ignore',
22
+ detached: true,
23
+ shell: true
24
+ }).unref();
25
+ } else if (platform() === 'darwin') {
26
+ // macOS
27
+ spawn('open', [url], { stdio: 'ignore', detached: true }).unref();
28
+ } else {
29
+ // Linux
30
+ spawn('xdg-open', [url], { stdio: 'ignore', detached: true }).unref();
31
+ }
32
+ } catch (error) {
33
+ console.log(`\n⚠️ 无法自动打开浏览器,请手动访问: ${url}`);
34
+ }
21
35
  }
22
36
 
23
37
  // 检查是否在正确的目录
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabdocchat",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "开源的实时协作文档聊天平台 - 集成任务管理、多人文档编辑、智能点名功能",
5
5
  "main": "./server/index.js",
6
6
  "type": "module",