mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 内核参数 --resident 和 --readonly 参数解析问题 Fix https://github.com/siyuan-note/siyuan/issues/6345
This commit is contained in:
parent
f4c3be9bd0
commit
ffc35d8573
2 changed files with 6 additions and 6 deletions
|
|
@ -538,18 +538,18 @@ const initKernel = (initData) => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let cmd = `ui version [${appVer}], booting kernel [${kernelPath} --wd=${appDir}]`
|
|
||||||
const cmds = ['--wd', appDir]
|
const cmds = ['--wd', appDir]
|
||||||
cmds.push('--resident', 'false')
|
cmds.push('--resident', 'false')
|
||||||
if (isDevEnv) {
|
if (isDevEnv) {
|
||||||
cmds.push('--mode', 'dev')
|
cmds.push('--mode', 'dev')
|
||||||
|
cmds.push('--port', '6806')
|
||||||
}
|
}
|
||||||
if (initData) {
|
if (initData) {
|
||||||
const initDatas = initData.split('-')
|
const initDatas = initData.split('-')
|
||||||
cmds.push('--workspace', initDatas[0])
|
cmds.push('--workspace', initDatas[0])
|
||||||
cmds.push('--lang', initDatas[1])
|
cmds.push('--lang', initDatas[1])
|
||||||
cmd = `ui version [${appVer}], booting kernel [${kernelPath} --wd=${appDir} --workspace=${initDatas[0]} --lang=${initDatas[1]}]`
|
|
||||||
}
|
}
|
||||||
|
let cmd = `ui version [${appVer}], booting kernel [${kernelPath} ${cmds.join(' ')}]`
|
||||||
writeLog(cmd)
|
writeLog(cmd)
|
||||||
const cp = require('child_process')
|
const cp = require('child_process')
|
||||||
const kernelProcess = cp.spawn(kernelPath,
|
const kernelProcess = cp.spawn(kernelPath,
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ func Boot() {
|
||||||
servePath := flag.String("servePath", "", "obsoleted https://github.com/siyuan-note/siyuan/issues/4647")
|
servePath := flag.String("servePath", "", "obsoleted https://github.com/siyuan-note/siyuan/issues/4647")
|
||||||
_ = servePath
|
_ = servePath
|
||||||
port := flag.String("port", "0", "port of the HTTP server")
|
port := flag.String("port", "0", "port of the HTTP server")
|
||||||
resident := flag.Bool("resident", true, "resident memory even if no active session")
|
resident := flag.String("resident", "true", "resident memory even if no active session")
|
||||||
readOnly := flag.Bool("readonly", false, "read-only mode")
|
readOnly := flag.String("readonly", "false", "read-only mode")
|
||||||
accessAuthCode := flag.String("accessAuthCode", "", "access auth code")
|
accessAuthCode := flag.String("accessAuthCode", "", "access auth code")
|
||||||
ssl := flag.Bool("ssl", false, "for https and wss")
|
ssl := flag.Bool("ssl", false, "for https and wss")
|
||||||
lang := flag.String("lang", "", "zh_CN/zh_CHT/en_US/fr_FR/es_ES")
|
lang := flag.String("lang", "", "zh_CN/zh_CHT/en_US/fr_FR/es_ES")
|
||||||
|
|
@ -76,12 +76,12 @@ func Boot() {
|
||||||
Lang = *lang
|
Lang = *lang
|
||||||
}
|
}
|
||||||
Mode = *mode
|
Mode = *mode
|
||||||
Resident = *resident
|
Resident, _ = strconv.ParseBool(*resident)
|
||||||
ServerPort = *port
|
ServerPort = *port
|
||||||
if isRunningInDockerContainer() || "dev" == Mode {
|
if isRunningInDockerContainer() || "dev" == Mode {
|
||||||
ServerPort = "6806"
|
ServerPort = "6806"
|
||||||
}
|
}
|
||||||
ReadOnly = *readOnly
|
ReadOnly, _ = strconv.ParseBool(*readOnly)
|
||||||
AccessAuthCode = *accessAuthCode
|
AccessAuthCode = *accessAuthCode
|
||||||
Container = ContainerStd
|
Container = ContainerStd
|
||||||
if isRunningInDockerContainer() {
|
if isRunningInDockerContainer() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue