mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 桌面端支持同时打开多个工作空间 https://github.com/siyuan-note/siyuan/issues/4567
This commit is contained in:
parent
cdc8f4154d
commit
3131281724
1 changed files with 17 additions and 5 deletions
|
|
@ -53,9 +53,7 @@ try {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
require('electron').
|
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||||
dialog.
|
|
||||||
showErrorBox('创建配置目录失败 Failed to create config directory',
|
|
||||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||||
app.exit()
|
app.exit()
|
||||||
}
|
}
|
||||||
|
|
@ -416,6 +414,8 @@ const initKernel = (workspace, lang) => {
|
||||||
}
|
}
|
||||||
if (workspace) {
|
if (workspace) {
|
||||||
cmds.push('--workspace', workspace)
|
cmds.push('--workspace', workspace)
|
||||||
|
}
|
||||||
|
if (lang) {
|
||||||
cmds.push('--lang', lang)
|
cmds.push('--lang', lang)
|
||||||
}
|
}
|
||||||
let cmd = `ui version [${appVer}], booting kernel [${kernelPath} ${cmds.join(
|
let cmd = `ui version [${appVer}], booting kernel [${kernelPath} ${cmds.join(
|
||||||
|
|
@ -826,7 +826,19 @@ app.whenReady().then(() => {
|
||||||
firstOpenWindow.destroy()
|
firstOpenWindow.destroy()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
initKernel().then((isSucc) => {
|
const getArg = (name) => {
|
||||||
|
for (let i = 0; i < process.argv.length; i++) {
|
||||||
|
if (process.argv[i] === name) {
|
||||||
|
return process.argv[i + 1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const workspace = getArg("--workspace")
|
||||||
|
if (workspace) {
|
||||||
|
writeLog("got arg [--workspace=" + workspace + "]")
|
||||||
|
}
|
||||||
|
initKernel(workspace).then((isSucc) => {
|
||||||
if (isSucc) {
|
if (isSucc) {
|
||||||
boot()
|
boot()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue