From 5d6deb5a00b63563badf5e0e9f52750913769991 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 2 Mar 2025 04:02:28 +0000 Subject: [PATCH 1/2] :memo: add localstore cwd config --- website/docs/best-practice/data-storing.md | 10 ++++++++++ .../version-2.3.3/best-practice/data-storing.md | 10 ++++++++++ .../version-2.4.0/best-practice/data-storing.md | 10 ++++++++++ .../version-2.4.1/best-practice/data-storing.md | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/website/docs/best-practice/data-storing.md b/website/docs/best-practice/data-storing.md index 95ad7970297c..0daa489110b0 100644 --- a/website/docs/best-practice/data-storing.md +++ b/website/docs/best-practice/data-storing.md @@ -68,6 +68,16 @@ data = data_file.read_text() ## 配置项 +### localstore_use_cwd + +使用当前工作目录作为数据存储目录 + +默认值:`False` + +```dotenv +LOCALSTORE_USE_CWD=true +``` + ### localstore_cache_dir 自定义缓存目录 diff --git a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md index 95ad7970297c..0daa489110b0 100644 --- a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md @@ -68,6 +68,16 @@ data = data_file.read_text() ## 配置项 +### localstore_use_cwd + +使用当前工作目录作为数据存储目录 + +默认值:`False` + +```dotenv +LOCALSTORE_USE_CWD=true +``` + ### localstore_cache_dir 自定义缓存目录 diff --git a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md index 95ad7970297c..0daa489110b0 100644 --- a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md @@ -68,6 +68,16 @@ data = data_file.read_text() ## 配置项 +### localstore_use_cwd + +使用当前工作目录作为数据存储目录 + +默认值:`False` + +```dotenv +LOCALSTORE_USE_CWD=true +``` + ### localstore_cache_dir 自定义缓存目录 diff --git a/website/versioned_docs/version-2.4.1/best-practice/data-storing.md b/website/versioned_docs/version-2.4.1/best-practice/data-storing.md index 95ad7970297c..0daa489110b0 100644 --- a/website/versioned_docs/version-2.4.1/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.4.1/best-practice/data-storing.md @@ -68,6 +68,16 @@ data = data_file.read_text() ## 配置项 +### localstore_use_cwd + +使用当前工作目录作为数据存储目录 + +默认值:`False` + +```dotenv +LOCALSTORE_USE_CWD=true +``` + ### localstore_cache_dir 自定义缓存目录 From 88493555e76e9b8e857ce5bfd9949cf70a7af72e Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 2 Mar 2025 04:24:21 +0000 Subject: [PATCH 2/2] :memo: udpate docs --- website/docs/best-practice/data-storing.md | 28 +++++++++++-------- .../best-practice/data-storing.md | 28 +++++++++++-------- .../best-practice/data-storing.md | 28 +++++++++++-------- .../best-practice/data-storing.md | 28 +++++++++++-------- 4 files changed, 68 insertions(+), 44 deletions(-) diff --git a/website/docs/best-practice/data-storing.md b/website/docs/best-practice/data-storing.md index 0daa489110b0..d88214c0bb0a 100644 --- a/website/docs/best-practice/data-storing.md +++ b/website/docs/best-practice/data-storing.md @@ -70,7 +70,7 @@ data = data_file.read_text() ### localstore_use_cwd -使用当前工作目录作为数据存储目录 +使用当前工作目录作为数据存储目录,以下数据目录配置项默认值将会对应变更 默认值:`False` @@ -84,9 +84,11 @@ LOCALSTORE_USE_CWD=true 默认值: -- macOS: `~/Library/Caches/` -- Unix: `~/.cache/` (XDG default) -- Windows: `C:\Users\\AppData\Local\\Cache` +当 `localstore_use_cwd` 为 `True` 时,缓存目录为 `/cache`,否则: + +- macOS: `~/Library/Caches/nonebot2` +- Unix: `~/.cache/nonebot2` (XDG default) +- Windows: `C:\Users\\AppData\Local\nonebot2\Cache` ```dotenv LOCALSTORE_CACHE_DIR=/tmp/cache @@ -98,10 +100,12 @@ LOCALSTORE_CACHE_DIR=/tmp/cache 默认值: -- macOS: `~/Library/Application Support/` -- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined -- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` -- Win 7 (not roaming): `C:\Users\\AppData\Local\` +当 `localstore_use_cwd` 为 `True` 时,数据目录为 `/data`,否则: + +- macOS: `~/Library/Application Support/nonebot2` +- Unix: `~/.local/share/nonebot2` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\nonebot2` +- Win 7 (not roaming): `C:\Users\\AppData\Local\nonebot2` ```dotenv LOCALSTORE_DATA_DIR=/tmp/data @@ -113,10 +117,12 @@ LOCALSTORE_DATA_DIR=/tmp/data 默认值: +当 `localstore_use_cwd` 为 `True` 时,配置目录为 `/config`,否则: + - macOS: same as user_data_dir -- Unix: `~/.config/` -- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` -- Win 7 (roaming): `C:\Users\\AppData\Roaming\` +- Unix: `~/.config/nonebot2` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\nonebot2` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\nonebot2` ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config diff --git a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md index 0daa489110b0..d88214c0bb0a 100644 --- a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md @@ -70,7 +70,7 @@ data = data_file.read_text() ### localstore_use_cwd -使用当前工作目录作为数据存储目录 +使用当前工作目录作为数据存储目录,以下数据目录配置项默认值将会对应变更 默认值:`False` @@ -84,9 +84,11 @@ LOCALSTORE_USE_CWD=true 默认值: -- macOS: `~/Library/Caches/` -- Unix: `~/.cache/` (XDG default) -- Windows: `C:\Users\\AppData\Local\\Cache` +当 `localstore_use_cwd` 为 `True` 时,缓存目录为 `/cache`,否则: + +- macOS: `~/Library/Caches/nonebot2` +- Unix: `~/.cache/nonebot2` (XDG default) +- Windows: `C:\Users\\AppData\Local\nonebot2\Cache` ```dotenv LOCALSTORE_CACHE_DIR=/tmp/cache @@ -98,10 +100,12 @@ LOCALSTORE_CACHE_DIR=/tmp/cache 默认值: -- macOS: `~/Library/Application Support/` -- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined -- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` -- Win 7 (not roaming): `C:\Users\\AppData\Local\` +当 `localstore_use_cwd` 为 `True` 时,数据目录为 `/data`,否则: + +- macOS: `~/Library/Application Support/nonebot2` +- Unix: `~/.local/share/nonebot2` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\nonebot2` +- Win 7 (not roaming): `C:\Users\\AppData\Local\nonebot2` ```dotenv LOCALSTORE_DATA_DIR=/tmp/data @@ -113,10 +117,12 @@ LOCALSTORE_DATA_DIR=/tmp/data 默认值: +当 `localstore_use_cwd` 为 `True` 时,配置目录为 `/config`,否则: + - macOS: same as user_data_dir -- Unix: `~/.config/` -- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` -- Win 7 (roaming): `C:\Users\\AppData\Roaming\` +- Unix: `~/.config/nonebot2` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\nonebot2` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\nonebot2` ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config diff --git a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md index 0daa489110b0..d88214c0bb0a 100644 --- a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md @@ -70,7 +70,7 @@ data = data_file.read_text() ### localstore_use_cwd -使用当前工作目录作为数据存储目录 +使用当前工作目录作为数据存储目录,以下数据目录配置项默认值将会对应变更 默认值:`False` @@ -84,9 +84,11 @@ LOCALSTORE_USE_CWD=true 默认值: -- macOS: `~/Library/Caches/` -- Unix: `~/.cache/` (XDG default) -- Windows: `C:\Users\\AppData\Local\\Cache` +当 `localstore_use_cwd` 为 `True` 时,缓存目录为 `/cache`,否则: + +- macOS: `~/Library/Caches/nonebot2` +- Unix: `~/.cache/nonebot2` (XDG default) +- Windows: `C:\Users\\AppData\Local\nonebot2\Cache` ```dotenv LOCALSTORE_CACHE_DIR=/tmp/cache @@ -98,10 +100,12 @@ LOCALSTORE_CACHE_DIR=/tmp/cache 默认值: -- macOS: `~/Library/Application Support/` -- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined -- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` -- Win 7 (not roaming): `C:\Users\\AppData\Local\` +当 `localstore_use_cwd` 为 `True` 时,数据目录为 `/data`,否则: + +- macOS: `~/Library/Application Support/nonebot2` +- Unix: `~/.local/share/nonebot2` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\nonebot2` +- Win 7 (not roaming): `C:\Users\\AppData\Local\nonebot2` ```dotenv LOCALSTORE_DATA_DIR=/tmp/data @@ -113,10 +117,12 @@ LOCALSTORE_DATA_DIR=/tmp/data 默认值: +当 `localstore_use_cwd` 为 `True` 时,配置目录为 `/config`,否则: + - macOS: same as user_data_dir -- Unix: `~/.config/` -- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` -- Win 7 (roaming): `C:\Users\\AppData\Roaming\` +- Unix: `~/.config/nonebot2` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\nonebot2` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\nonebot2` ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config diff --git a/website/versioned_docs/version-2.4.1/best-practice/data-storing.md b/website/versioned_docs/version-2.4.1/best-practice/data-storing.md index 0daa489110b0..d88214c0bb0a 100644 --- a/website/versioned_docs/version-2.4.1/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.4.1/best-practice/data-storing.md @@ -70,7 +70,7 @@ data = data_file.read_text() ### localstore_use_cwd -使用当前工作目录作为数据存储目录 +使用当前工作目录作为数据存储目录,以下数据目录配置项默认值将会对应变更 默认值:`False` @@ -84,9 +84,11 @@ LOCALSTORE_USE_CWD=true 默认值: -- macOS: `~/Library/Caches/` -- Unix: `~/.cache/` (XDG default) -- Windows: `C:\Users\\AppData\Local\\Cache` +当 `localstore_use_cwd` 为 `True` 时,缓存目录为 `/cache`,否则: + +- macOS: `~/Library/Caches/nonebot2` +- Unix: `~/.cache/nonebot2` (XDG default) +- Windows: `C:\Users\\AppData\Local\nonebot2\Cache` ```dotenv LOCALSTORE_CACHE_DIR=/tmp/cache @@ -98,10 +100,12 @@ LOCALSTORE_CACHE_DIR=/tmp/cache 默认值: -- macOS: `~/Library/Application Support/` -- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined -- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` -- Win 7 (not roaming): `C:\Users\\AppData\Local\` +当 `localstore_use_cwd` 为 `True` 时,数据目录为 `/data`,否则: + +- macOS: `~/Library/Application Support/nonebot2` +- Unix: `~/.local/share/nonebot2` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\nonebot2` +- Win 7 (not roaming): `C:\Users\\AppData\Local\nonebot2` ```dotenv LOCALSTORE_DATA_DIR=/tmp/data @@ -113,10 +117,12 @@ LOCALSTORE_DATA_DIR=/tmp/data 默认值: +当 `localstore_use_cwd` 为 `True` 时,配置目录为 `/config`,否则: + - macOS: same as user_data_dir -- Unix: `~/.config/` -- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` -- Win 7 (roaming): `C:\Users\\AppData\Roaming\` +- Unix: `~/.config/nonebot2` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\nonebot2` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\nonebot2` ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config