Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
1b3d9c1d69
8 changed files with 48 additions and 107 deletions
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
|
@ -14,10 +14,10 @@ Install pnpm: `npm install -g pnpm`
|
|||
|
||||
Set the Electron mirror environment variable and install Electron:
|
||||
|
||||
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@19.0.10 -D`
|
||||
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@20.0.2 -D`
|
||||
* Windows:
|
||||
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
|
||||
* `pnpm install electron@19.0.10 -D`
|
||||
* `pnpm install electron@20.0.2 -D`
|
||||
|
||||
NPM mirror:
|
||||
|
||||
|
@ -28,7 +28,7 @@ NPM mirror:
|
|||
|
||||
On the desktop, go to the app folder to run:
|
||||
|
||||
* `pnpm install electron@19.0.10 -D`
|
||||
* `pnpm install electron@20.0.2 -D`
|
||||
* `pnpm run dev`
|
||||
* `pnpm run start`
|
||||
|
||||
|
|
6
.github/CONTRIBUTING_zh_CN.md
vendored
6
.github/CONTRIBUTING_zh_CN.md
vendored
|
@ -14,10 +14,10 @@
|
|||
|
||||
设置 Electron 镜像环境变量并安装 Electron:
|
||||
|
||||
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@19.0.10 -D`
|
||||
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@20.0.2 -D`
|
||||
* Windows:
|
||||
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
|
||||
* `pnpm install electron@19.0.10 -D`
|
||||
* `pnpm install electron@20.0.2 -D`
|
||||
|
||||
NPM 镜像:
|
||||
|
||||
|
@ -27,7 +27,7 @@ NPM 镜像:
|
|||
|
||||
桌面端进入 app 文件夹运行:
|
||||
|
||||
* `pnpm install electron@19.0.10 -D`
|
||||
* `pnpm install electron@20.0.2 -D`
|
||||
* `pnpm run dev`
|
||||
* `pnpm run start`
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ const initKernel = (initData) => {
|
|||
break
|
||||
case 23:
|
||||
showErrorWindow('⚠️ 无法读写块树文件 Failed to access blocktree file',
|
||||
`<div>块树文件正在被其他程序锁定。如果你使用了第三方同步盘,请在思源运行期间关闭同步。</div><div>The block tree file is being locked by another program. If you use a third-party sync disk, please turn off the sync while SiYuan is running.</div>`)
|
||||
`<div>块树文件正在被其他程序锁定或者已经损坏,请删除 工作空间/temp/ 文件夹后重启</div><div>The block tree file is being locked by another program or is damaged, please delete the workspace/temp/ folder and restart.</div>`)
|
||||
break
|
||||
case 0:
|
||||
case 1: // Fatal error
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"clean-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"dayjs": "^1.11.3",
|
||||
"electron": "19.0.10",
|
||||
"electron": "20.0.2",
|
||||
"electron-builder": "^23.3.1",
|
||||
"encoding": "^0.1.13",
|
||||
"eslint": "^8.19.0",
|
||||
|
|
91
app/pnpm-lock.yaml
generated
91
app/pnpm-lock.yaml
generated
|
@ -15,7 +15,7 @@ specifiers:
|
|||
clean-webpack-plugin: ^4.0.0
|
||||
css-loader: ^6.7.1
|
||||
dayjs: ^1.11.3
|
||||
electron: 19.0.10
|
||||
electron: 20.0.2
|
||||
electron-builder: ^23.3.1
|
||||
electron-fetch: ^1.7.4
|
||||
encoding: ^0.1.13
|
||||
|
@ -39,7 +39,7 @@ specifiers:
|
|||
webpack-cli: ^4.10.0
|
||||
|
||||
dependencies:
|
||||
'@electron/remote': 2.0.8_electron@19.0.10
|
||||
'@electron/remote': 2.0.8_electron@20.0.2
|
||||
electron-fetch: 1.7.4
|
||||
pnpm: 7.5.1
|
||||
|
||||
|
@ -57,7 +57,7 @@ devDependencies:
|
|||
clean-webpack-plugin: 4.0.0_webpack@5.73.0
|
||||
css-loader: 6.7.1_webpack@5.73.0
|
||||
dayjs: 1.11.3
|
||||
electron: 19.0.10
|
||||
electron: 20.0.2
|
||||
electron-builder: 23.3.1
|
||||
encoding: 0.1.13
|
||||
eslint: 8.19.0
|
||||
|
@ -1274,12 +1274,12 @@ packages:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
/@electron/remote/2.0.8_electron@19.0.10:
|
||||
/@electron/remote/2.0.8_electron@20.0.2:
|
||||
resolution: {integrity: sha512-P10v3+iFCIvEPeYzTWWGwwHmqWnjoh8RYnbtZAb3RlQefy4guagzIwcWtfftABIfm6JJTNQf4WPSKWZOpLmHXw==}
|
||||
peerDependencies:
|
||||
electron: '>= 13.0.0'
|
||||
dependencies:
|
||||
electron: 19.0.10
|
||||
electron: 20.0.2
|
||||
dev: false
|
||||
|
||||
/@electron/universal/1.2.1:
|
||||
|
@ -1534,6 +1534,13 @@ packages:
|
|||
'@types/yargs-parser': 21.0.0
|
||||
dev: true
|
||||
|
||||
/@types/yauzl/2.10.0:
|
||||
resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@types/node': 17.0.45
|
||||
optional: true
|
||||
|
||||
/@typescript-eslint/eslint-plugin/5.30.6_2vt5mtrqleafs33qg2bhpmbaqm:
|
||||
resolution: {integrity: sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
@ -1899,10 +1906,10 @@ packages:
|
|||
resolution: {integrity: sha512-mi4DG3m32cMJ5CtO9iYk41gBvGWLzJjQsaQgGOd4ZhmIuKyj8M/0rT1g0s/0qD4Tw8jsa//NXMXCC7vpGIfkTg==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
dependencies:
|
||||
7zip-bin: 5.1.1
|
||||
'@develar/schema-utils': 2.6.5
|
||||
'@electron/universal': 1.2.1
|
||||
'@malept/flatpak-bundler': 0.4.0
|
||||
7zip-bin: 5.1.1
|
||||
async-exit-hook: 2.0.1
|
||||
bluebird-lst: 1.0.9
|
||||
builder-util: 23.3.0
|
||||
|
@ -2162,6 +2169,7 @@ packages:
|
|||
|
||||
/buffer-from/1.1.2:
|
||||
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
||||
dev: true
|
||||
|
||||
/buffer/5.7.1:
|
||||
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
||||
|
@ -2185,9 +2193,9 @@ packages:
|
|||
/builder-util/23.3.0:
|
||||
resolution: {integrity: sha512-m7RRd21N2yrnuGFd+ZqOY0ryeqWmBslDKmGDVz0wETqoEEqpiJsF3CGlsb6MRN2EQKDubvE5e+lBf8ATt06fnA==}
|
||||
dependencies:
|
||||
7zip-bin: 5.1.1
|
||||
'@types/debug': 4.1.7
|
||||
'@types/fs-extra': 9.0.13
|
||||
7zip-bin: 5.1.1
|
||||
app-builder-bin: 4.0.0
|
||||
bluebird-lst: 1.0.9
|
||||
builder-util-runtime: 9.0.3
|
||||
|
@ -2442,15 +2450,6 @@ packages:
|
|||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
dev: true
|
||||
|
||||
/concat-stream/1.6.2:
|
||||
resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
|
||||
engines: {'0': node >= 0.8}
|
||||
dependencies:
|
||||
buffer-from: 1.1.2
|
||||
inherits: 2.0.4
|
||||
readable-stream: 2.3.7
|
||||
typedarray: 0.0.6
|
||||
|
||||
/config-chain/1.1.13:
|
||||
resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==}
|
||||
dependencies:
|
||||
|
@ -2494,9 +2493,6 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/core-util-is/1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
|
||||
/crc/3.8.0:
|
||||
resolution: {integrity: sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==}
|
||||
requiresBuild: true
|
||||
|
@ -2570,6 +2566,7 @@ packages:
|
|||
optional: true
|
||||
dependencies:
|
||||
ms: 2.0.0
|
||||
dev: true
|
||||
|
||||
/debug/4.3.4:
|
||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
||||
|
@ -2818,15 +2815,15 @@ packages:
|
|||
resolution: {integrity: sha512-YoVeFrGd/7ROjz4R9uPoND1K/hSRC/xADy9639ZmIZeJSaBnKdYx3I6LMPsY7CXLpK7JFgKQVzeZ/dk2br6Eaw==}
|
||||
dev: true
|
||||
|
||||
/electron/19.0.10:
|
||||
resolution: {integrity: sha512-EiWtPWdD7CzkRkp1cw7t0N9W2qhI5XZOudHX7daOh5wI076nsdV2dtlAf/XyTHhPNoKR5qhTWrSnYL9PY6D1vg==}
|
||||
engines: {node: '>= 8.6'}
|
||||
/electron/20.0.2:
|
||||
resolution: {integrity: sha512-Op4nxSyXH0tXjhvWC+WDn9EI0gep5etPccainxu1A4wes+ZFQBMCBXxibotanJfG+WNW4RaOv88NArwHIsSmPw==}
|
||||
engines: {node: '>= 10.17.0'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@electron/get': 1.14.1
|
||||
'@types/node': 16.11.43
|
||||
extract-zip: 1.7.0
|
||||
extract-zip: 2.0.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
@ -3026,14 +3023,16 @@ packages:
|
|||
engines: {node: '>=0.8.x'}
|
||||
dev: true
|
||||
|
||||
/extract-zip/1.7.0:
|
||||
resolution: {integrity: sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==}
|
||||
/extract-zip/2.0.1:
|
||||
resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
|
||||
engines: {node: '>= 10.17.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
concat-stream: 1.6.2
|
||||
debug: 2.6.9
|
||||
mkdirp: 0.5.6
|
||||
debug: 4.3.4
|
||||
get-stream: 5.2.0
|
||||
yauzl: 2.10.0
|
||||
optionalDependencies:
|
||||
'@types/yauzl': 2.10.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
@ -3578,6 +3577,7 @@ packages:
|
|||
|
||||
/inherits/2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: true
|
||||
|
||||
/ini/1.3.8:
|
||||
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
|
||||
|
@ -3698,9 +3698,6 @@ packages:
|
|||
resolution: {integrity: sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==}
|
||||
dev: true
|
||||
|
||||
/isarray/1.0.0:
|
||||
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
|
||||
|
||||
/isbinaryfile/3.0.3:
|
||||
resolution: {integrity: sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==}
|
||||
engines: {node: '>=0.6.0'}
|
||||
|
@ -3988,6 +3985,7 @@ packages:
|
|||
|
||||
/minimist/1.2.6:
|
||||
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
|
||||
dev: true
|
||||
|
||||
/minipass/3.3.4:
|
||||
resolution: {integrity: sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==}
|
||||
|
@ -4004,12 +4002,6 @@ packages:
|
|||
yallist: 4.0.0
|
||||
dev: true
|
||||
|
||||
/mkdirp/0.5.6:
|
||||
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
minimist: 1.2.6
|
||||
|
||||
/mkdirp/1.0.4:
|
||||
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -4023,6 +4015,7 @@ packages:
|
|||
|
||||
/ms/2.0.0:
|
||||
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
|
||||
dev: true
|
||||
|
||||
/ms/2.1.2:
|
||||
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
|
||||
|
@ -4359,9 +4352,6 @@ packages:
|
|||
renderkid: 3.0.0
|
||||
dev: true
|
||||
|
||||
/process-nextick-args/2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
|
||||
/progress/2.0.3:
|
||||
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
|
@ -4419,17 +4409,6 @@ packages:
|
|||
lazy-val: 1.0.5
|
||||
dev: true
|
||||
|
||||
/readable-stream/2.3.7:
|
||||
resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==}
|
||||
dependencies:
|
||||
core-util-is: 1.0.3
|
||||
inherits: 2.0.4
|
||||
isarray: 1.0.0
|
||||
process-nextick-args: 2.0.1
|
||||
safe-buffer: 5.1.2
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
|
||||
/readdirp/3.6.0:
|
||||
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
|
||||
engines: {node: '>=8.10.0'}
|
||||
|
@ -4597,6 +4576,7 @@ packages:
|
|||
|
||||
/safe-buffer/5.1.2:
|
||||
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
|
||||
dev: true
|
||||
|
||||
/safe-buffer/5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
|
@ -4798,11 +4778,6 @@ packages:
|
|||
strip-ansi: 6.0.1
|
||||
dev: true
|
||||
|
||||
/string_decoder/1.1.1:
|
||||
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
|
||||
/strip-ansi/6.0.1:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -5029,9 +5004,6 @@ packages:
|
|||
is-typedarray: 1.0.0
|
||||
dev: true
|
||||
|
||||
/typedarray/0.0.6:
|
||||
resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==}
|
||||
|
||||
/typescript/4.7.4:
|
||||
resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
|
@ -5126,6 +5098,7 @@ packages:
|
|||
|
||||
/util-deprecate/1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: true
|
||||
|
||||
/utila/0.4.0:
|
||||
resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==}
|
||||
|
|
|
@ -510,9 +510,8 @@ func InitBoxes() {
|
|||
}
|
||||
|
||||
for _, box := range Conf.GetOpenedBoxes() {
|
||||
box.UpdateHistoryGenerated() // 初始化历史生成时间为当前时间
|
||||
if !initialized {
|
||||
box.BootIndex()
|
||||
box.Index(true)
|
||||
}
|
||||
|
||||
ListDocTree(box.ID, "/", Conf.FileTree.Sort) // 缓存根一级的文档树展开
|
||||
|
|
|
@ -40,44 +40,6 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func (box *Box) BootIndex() {
|
||||
util.SetBootDetails("Listing files...")
|
||||
files := box.ListFiles("/")
|
||||
boxLen := len(Conf.GetOpenedBoxes())
|
||||
if 1 > boxLen {
|
||||
boxLen = 1
|
||||
}
|
||||
bootProgressPart := 10.0 / float64(boxLen) / float64(len(files))
|
||||
|
||||
luteEngine := NewLute()
|
||||
i := 0
|
||||
// 读取并缓存路径映射
|
||||
for _, file := range files {
|
||||
if file.isdir || !strings.HasSuffix(file.name, ".sy") {
|
||||
continue
|
||||
}
|
||||
|
||||
p := file.path
|
||||
tree, err := filesys.LoadTree(box.ID, p, luteEngine)
|
||||
if nil != err {
|
||||
logging.LogErrorf("read box [%s] tree [%s] failed: %s", box.ID, p, err)
|
||||
continue
|
||||
}
|
||||
|
||||
docIAL := parse.IAL2MapUnEsc(tree.Root.KramdownIAL)
|
||||
cache.PutDocIAL(p, docIAL)
|
||||
|
||||
util.IncBootProgress(bootProgressPart, "Parsing tree "+util.ShortPathForBootingDisplay(tree.Path))
|
||||
// 缓存块树
|
||||
treenode.IndexBlockTree(tree)
|
||||
if 1 < i && 0 == i%64 {
|
||||
filelock.ReleaseAllFileLocks()
|
||||
}
|
||||
i++
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (box *Box) Index(fullRebuildIndex bool) (treeCount int, treeSize int64) {
|
||||
defer debug.FreeOSMemory()
|
||||
|
||||
|
|
|
@ -194,6 +194,13 @@ func initWorkspaceDir(workspaceArg string) {
|
|||
}
|
||||
|
||||
defaultWorkspaceDir := filepath.Join(HomeDir, "Documents", "SiYuan")
|
||||
if gulu.OS.IsWindows() {
|
||||
// 改进 Windows 端默认工作空间路径 https://github.com/siyuan-note/siyuan/issues/5622
|
||||
if userProfile := os.Getenv("USERPROFILE"); "" != userProfile {
|
||||
defaultWorkspaceDir = filepath.Join(userProfile, "Documents", "SiYuan")
|
||||
}
|
||||
}
|
||||
|
||||
var workspacePaths []string
|
||||
if !gulu.File.IsExist(workspaceConf) {
|
||||
WorkspaceDir = defaultWorkspaceDir
|
||||
|
|
Loading…
Add table
Reference in a new issue