From 75f5825cffbed9510c221e7edef26e0da42f1dc3 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Tue, 13 Aug 2024 15:38:17 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20Docs:=20=E6=B7=BB=E5=8A=A0=20Windows?= =?UTF-8?q?=20Powershell=20=E8=AE=BE=E7=BD=AE=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=96=B9=E6=B3=95=20(#2874)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> --- website/docs/appendices/config.mdx | 45 ++++++++++++++----- .../version-2.3.0/appendices/config.mdx | 45 ++++++++++++++----- .../version-2.3.1/appendices/config.mdx | 45 ++++++++++++++----- .../version-2.3.2/appendices/config.mdx | 45 ++++++++++++++----- 4 files changed, 132 insertions(+), 48 deletions(-) diff --git a/website/docs/appendices/config.mdx b/website/docs/appendices/config.mdx index 98d6861d..59d8122f 100644 --- a/website/docs/appendices/config.mdx +++ b/website/docs/appendices/config.mdx @@ -73,10 +73,12 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows -set CUSTOM_CONFIG "config in environment variables" +# windows cmd +set CUSTOM_CONFIG 'config in environment variables' +# windows powershell +$Env:CUSTOM_CONFIG='config in environment variables' # linux/macOS -export CUSTOM_CONFIG="config in environment variables" +export CUSTOM_CONFIG='config in environment variables' ``` 那最终 NoneBot 所读取的内容为环境变量中的内容,即 `config in environment variables`。 @@ -295,8 +297,10 @@ DRIVER=~fastapi+~httpx+~websockets ```bash -# windows +# windows cmd set DRIVER '~fastapi+~httpx+~websockets' +# windows powershell +$Env:DRIVER='~fastapi+~httpx+~websockets' # linux/macOS export DRIVER='~fastapi+~httpx+~websockets' ``` @@ -331,8 +335,10 @@ HOST=127.0.0.1 ```bash -# windows +# windows cmd set HOST '127.0.0.1' +# windows powershell +$Env:HOST='127.0.0.1' # linux/macOS export HOST='127.0.0.1' ``` @@ -367,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -407,8 +415,10 @@ LOG_LEVEL=DEBUG ```bash -# windows +# windows cmd set LOG_LEVEL 'DEBUG' +# windows powershell +$Env:LOG_LEVEL='DEBUG' # linux/macOS export LOG_LEVEL='DEBUG' ``` @@ -443,8 +453,10 @@ API_TIMEOUT=10.0 ```bash -# windows +# windows cmd set API_TIMEOUT '10.0' +# windows powershell +$Env:API_TIMEOUT='10.0' # linux/macOS export API_TIMEOUT='10.0' ``` @@ -479,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -515,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -554,9 +570,12 @@ COMMAND_SEP=[".", " "] ```bash -# windows +# windows cmd set COMMAND_START '["/", ""]' set COMMAND_SEP '[".", " "]' +# windows powershell +$Env:COMMAND_START='["/", ""]' +$Env:COMMAND_SEP='[".", " "]' # linux/macOS export COMMAND_START='["/", ""]' export COMMAND_SEP='[".", " "]' @@ -592,8 +611,10 @@ SESSION_EXPIRE_TIMEOUT=00:02:00 ```bash -# windows +# windows cmd set SESSION_EXPIRE_TIMEOUT '00:02:00' +# windows powershell +$Env:SESSION_EXPIRE_TIMEOUT='00:02:00' # linux/macOS export SESSION_EXPIRE_TIMEOUT='00:02:00' ``` diff --git a/website/versioned_docs/version-2.3.0/appendices/config.mdx b/website/versioned_docs/version-2.3.0/appendices/config.mdx index 98d6861d..59d8122f 100644 --- a/website/versioned_docs/version-2.3.0/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.0/appendices/config.mdx @@ -73,10 +73,12 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows -set CUSTOM_CONFIG "config in environment variables" +# windows cmd +set CUSTOM_CONFIG 'config in environment variables' +# windows powershell +$Env:CUSTOM_CONFIG='config in environment variables' # linux/macOS -export CUSTOM_CONFIG="config in environment variables" +export CUSTOM_CONFIG='config in environment variables' ``` 那最终 NoneBot 所读取的内容为环境变量中的内容,即 `config in environment variables`。 @@ -295,8 +297,10 @@ DRIVER=~fastapi+~httpx+~websockets ```bash -# windows +# windows cmd set DRIVER '~fastapi+~httpx+~websockets' +# windows powershell +$Env:DRIVER='~fastapi+~httpx+~websockets' # linux/macOS export DRIVER='~fastapi+~httpx+~websockets' ``` @@ -331,8 +335,10 @@ HOST=127.0.0.1 ```bash -# windows +# windows cmd set HOST '127.0.0.1' +# windows powershell +$Env:HOST='127.0.0.1' # linux/macOS export HOST='127.0.0.1' ``` @@ -367,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -407,8 +415,10 @@ LOG_LEVEL=DEBUG ```bash -# windows +# windows cmd set LOG_LEVEL 'DEBUG' +# windows powershell +$Env:LOG_LEVEL='DEBUG' # linux/macOS export LOG_LEVEL='DEBUG' ``` @@ -443,8 +453,10 @@ API_TIMEOUT=10.0 ```bash -# windows +# windows cmd set API_TIMEOUT '10.0' +# windows powershell +$Env:API_TIMEOUT='10.0' # linux/macOS export API_TIMEOUT='10.0' ``` @@ -479,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -515,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -554,9 +570,12 @@ COMMAND_SEP=[".", " "] ```bash -# windows +# windows cmd set COMMAND_START '["/", ""]' set COMMAND_SEP '[".", " "]' +# windows powershell +$Env:COMMAND_START='["/", ""]' +$Env:COMMAND_SEP='[".", " "]' # linux/macOS export COMMAND_START='["/", ""]' export COMMAND_SEP='[".", " "]' @@ -592,8 +611,10 @@ SESSION_EXPIRE_TIMEOUT=00:02:00 ```bash -# windows +# windows cmd set SESSION_EXPIRE_TIMEOUT '00:02:00' +# windows powershell +$Env:SESSION_EXPIRE_TIMEOUT='00:02:00' # linux/macOS export SESSION_EXPIRE_TIMEOUT='00:02:00' ``` diff --git a/website/versioned_docs/version-2.3.1/appendices/config.mdx b/website/versioned_docs/version-2.3.1/appendices/config.mdx index 98d6861d..59d8122f 100644 --- a/website/versioned_docs/version-2.3.1/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.1/appendices/config.mdx @@ -73,10 +73,12 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows -set CUSTOM_CONFIG "config in environment variables" +# windows cmd +set CUSTOM_CONFIG 'config in environment variables' +# windows powershell +$Env:CUSTOM_CONFIG='config in environment variables' # linux/macOS -export CUSTOM_CONFIG="config in environment variables" +export CUSTOM_CONFIG='config in environment variables' ``` 那最终 NoneBot 所读取的内容为环境变量中的内容,即 `config in environment variables`。 @@ -295,8 +297,10 @@ DRIVER=~fastapi+~httpx+~websockets ```bash -# windows +# windows cmd set DRIVER '~fastapi+~httpx+~websockets' +# windows powershell +$Env:DRIVER='~fastapi+~httpx+~websockets' # linux/macOS export DRIVER='~fastapi+~httpx+~websockets' ``` @@ -331,8 +335,10 @@ HOST=127.0.0.1 ```bash -# windows +# windows cmd set HOST '127.0.0.1' +# windows powershell +$Env:HOST='127.0.0.1' # linux/macOS export HOST='127.0.0.1' ``` @@ -367,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -407,8 +415,10 @@ LOG_LEVEL=DEBUG ```bash -# windows +# windows cmd set LOG_LEVEL 'DEBUG' +# windows powershell +$Env:LOG_LEVEL='DEBUG' # linux/macOS export LOG_LEVEL='DEBUG' ``` @@ -443,8 +453,10 @@ API_TIMEOUT=10.0 ```bash -# windows +# windows cmd set API_TIMEOUT '10.0' +# windows powershell +$Env:API_TIMEOUT='10.0' # linux/macOS export API_TIMEOUT='10.0' ``` @@ -479,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -515,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -554,9 +570,12 @@ COMMAND_SEP=[".", " "] ```bash -# windows +# windows cmd set COMMAND_START '["/", ""]' set COMMAND_SEP '[".", " "]' +# windows powershell +$Env:COMMAND_START='["/", ""]' +$Env:COMMAND_SEP='[".", " "]' # linux/macOS export COMMAND_START='["/", ""]' export COMMAND_SEP='[".", " "]' @@ -592,8 +611,10 @@ SESSION_EXPIRE_TIMEOUT=00:02:00 ```bash -# windows +# windows cmd set SESSION_EXPIRE_TIMEOUT '00:02:00' +# windows powershell +$Env:SESSION_EXPIRE_TIMEOUT='00:02:00' # linux/macOS export SESSION_EXPIRE_TIMEOUT='00:02:00' ``` diff --git a/website/versioned_docs/version-2.3.2/appendices/config.mdx b/website/versioned_docs/version-2.3.2/appendices/config.mdx index 98d6861d..59d8122f 100644 --- a/website/versioned_docs/version-2.3.2/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.2/appendices/config.mdx @@ -73,10 +73,12 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows -set CUSTOM_CONFIG "config in environment variables" +# windows cmd +set CUSTOM_CONFIG 'config in environment variables' +# windows powershell +$Env:CUSTOM_CONFIG='config in environment variables' # linux/macOS -export CUSTOM_CONFIG="config in environment variables" +export CUSTOM_CONFIG='config in environment variables' ``` 那最终 NoneBot 所读取的内容为环境变量中的内容,即 `config in environment variables`。 @@ -295,8 +297,10 @@ DRIVER=~fastapi+~httpx+~websockets ```bash -# windows +# windows cmd set DRIVER '~fastapi+~httpx+~websockets' +# windows powershell +$Env:DRIVER='~fastapi+~httpx+~websockets' # linux/macOS export DRIVER='~fastapi+~httpx+~websockets' ``` @@ -331,8 +335,10 @@ HOST=127.0.0.1 ```bash -# windows +# windows cmd set HOST '127.0.0.1' +# windows powershell +$Env:HOST='127.0.0.1' # linux/macOS export HOST='127.0.0.1' ``` @@ -367,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -407,8 +415,10 @@ LOG_LEVEL=DEBUG ```bash -# windows +# windows cmd set LOG_LEVEL 'DEBUG' +# windows powershell +$Env:LOG_LEVEL='DEBUG' # linux/macOS export LOG_LEVEL='DEBUG' ``` @@ -443,8 +453,10 @@ API_TIMEOUT=10.0 ```bash -# windows +# windows cmd set API_TIMEOUT '10.0' +# windows powershell +$Env:API_TIMEOUT='10.0' # linux/macOS export API_TIMEOUT='10.0' ``` @@ -479,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -515,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -554,9 +570,12 @@ COMMAND_SEP=[".", " "] ```bash -# windows +# windows cmd set COMMAND_START '["/", ""]' set COMMAND_SEP '[".", " "]' +# windows powershell +$Env:COMMAND_START='["/", ""]' +$Env:COMMAND_SEP='[".", " "]' # linux/macOS export COMMAND_START='["/", ""]' export COMMAND_SEP='[".", " "]' @@ -592,8 +611,10 @@ SESSION_EXPIRE_TIMEOUT=00:02:00 ```bash -# windows +# windows cmd set SESSION_EXPIRE_TIMEOUT '00:02:00' +# windows powershell +$Env:SESSION_EXPIRE_TIMEOUT='00:02:00' # linux/macOS export SESSION_EXPIRE_TIMEOUT='00:02:00' ```