From 1562a0a008f7e854b8c3182d78a43351fbb019d8 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Mon, 12 Aug 2024 13:34:15 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Windows=20=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=BE=E7=BD=AE=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows 系统中有两种命令行, 其中的 powershell 设置命令行的方式和 cmd 有所不同, 本 commit 更新了 powershell 中正确设置环境变量的方法 --- website/versioned_docs/version-2.3.2/appendices/config.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 98d6861d0882..11b4808f2236 100644 --- a/website/versioned_docs/version-2.3.2/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.2/appendices/config.mdx @@ -73,8 +73,10 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows +# 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" ``` From eeb9f25617b37d9bef2288a2dcd2f50b4ae2c7b8 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Mon, 12 Aug 2024 13:44:04 +0800 Subject: [PATCH 2/8] Update config.mdx --- website/docs/appendices/config.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/appendices/config.mdx b/website/docs/appendices/config.mdx index 98d6861d0882..11b4808f2236 100644 --- a/website/docs/appendices/config.mdx +++ b/website/docs/appendices/config.mdx @@ -73,8 +73,10 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows +# 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" ``` From 59daee38b2cd7636e86033ca4ff1389bdd8d1829 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Mon, 12 Aug 2024 13:44:17 +0800 Subject: [PATCH 3/8] Update config.mdx --- website/versioned_docs/version-2.3.1/appendices/config.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 98d6861d0882..11b4808f2236 100644 --- a/website/versioned_docs/version-2.3.1/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.1/appendices/config.mdx @@ -73,8 +73,10 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows +# 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" ``` From f43ee62c8fa88023a12a441a31142ead3757d840 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Mon, 12 Aug 2024 13:44:31 +0800 Subject: [PATCH 4/8] Update config.mdx --- website/versioned_docs/version-2.3.0/appendices/config.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 98d6861d0882..11b4808f2236 100644 --- a/website/versioned_docs/version-2.3.0/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.0/appendices/config.mdx @@ -73,8 +73,10 @@ CUSTOM_CONFIG=config in dotenv 同时,设置环境变量: ```bash -# windows +# 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" ``` From c8042c140c09ff349bd96f5bbdc85e15dfda6940 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:21:54 +0800 Subject: [PATCH 5/8] :memo: update examples --- website/docs/appendices/config.mdx | 43 +++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/website/docs/appendices/config.mdx b/website/docs/appendices/config.mdx index 11b4808f2236..59d8122f45c7 100644 --- a/website/docs/appendices/config.mdx +++ b/website/docs/appendices/config.mdx @@ -74,11 +74,11 @@ CUSTOM_CONFIG=config in dotenv ```bash # windows cmd -set CUSTOM_CONFIG "config in environment variables" +set CUSTOM_CONFIG 'config in environment variables' # windows powershell -$env:CUSTOM_CONFIG="config in environment variables" +$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`。 @@ -297,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' ``` @@ -333,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' ``` @@ -369,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -409,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' ``` @@ -445,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' ``` @@ -481,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -517,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -556,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='[".", " "]' @@ -594,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' ``` From 77f560932263977e707c0cb7d852ca56b3eed6b0 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:23:35 +0800 Subject: [PATCH 6/8] Update config.mdx --- .../version-2.3.2/appendices/config.mdx | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) 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 11b4808f2236..59d8122f45c7 100644 --- a/website/versioned_docs/version-2.3.2/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.2/appendices/config.mdx @@ -74,11 +74,11 @@ CUSTOM_CONFIG=config in dotenv ```bash # windows cmd -set CUSTOM_CONFIG "config in environment variables" +set CUSTOM_CONFIG 'config in environment variables' # windows powershell -$env:CUSTOM_CONFIG="config in environment variables" +$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`。 @@ -297,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' ``` @@ -333,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' ``` @@ -369,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -409,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' ``` @@ -445,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' ``` @@ -481,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -517,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -556,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='[".", " "]' @@ -594,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' ``` From 5fbb5d4f610a000f8b74bc49714ec69409902f3b Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:24:03 +0800 Subject: [PATCH 7/8] Update config.mdx --- .../version-2.3.1/appendices/config.mdx | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) 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 11b4808f2236..59d8122f45c7 100644 --- a/website/versioned_docs/version-2.3.1/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.1/appendices/config.mdx @@ -74,11 +74,11 @@ CUSTOM_CONFIG=config in dotenv ```bash # windows cmd -set CUSTOM_CONFIG "config in environment variables" +set CUSTOM_CONFIG 'config in environment variables' # windows powershell -$env:CUSTOM_CONFIG="config in environment variables" +$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`。 @@ -297,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' ``` @@ -333,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' ``` @@ -369,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -409,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' ``` @@ -445,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' ``` @@ -481,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -517,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -556,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='[".", " "]' @@ -594,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' ``` From 8610f804d474e6f560620a73e5393ed13abb71f7 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:24:29 +0800 Subject: [PATCH 8/8] Update config.mdx --- .../version-2.3.0/appendices/config.mdx | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) 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 11b4808f2236..59d8122f45c7 100644 --- a/website/versioned_docs/version-2.3.0/appendices/config.mdx +++ b/website/versioned_docs/version-2.3.0/appendices/config.mdx @@ -74,11 +74,11 @@ CUSTOM_CONFIG=config in dotenv ```bash # windows cmd -set CUSTOM_CONFIG "config in environment variables" +set CUSTOM_CONFIG 'config in environment variables' # windows powershell -$env:CUSTOM_CONFIG="config in environment variables" +$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`。 @@ -297,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' ``` @@ -333,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' ``` @@ -369,8 +373,10 @@ PORT=8080 ```bash -# windows +# windows cmd set PORT '8080' +# windows powershell +$Env:PORT='8080' # linux/macOS export PORT='8080' ``` @@ -409,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' ``` @@ -445,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' ``` @@ -481,8 +491,10 @@ SUPERUSERS=["123123123"] ```bash -# windows +# windows cmd set SUPERUSERS '["123123123"]' +# windows powershell +$Env:SUPERUSERS='["123123123"]' # linux/macOS export SUPERUSERS='["123123123"]' ``` @@ -517,8 +529,10 @@ NICKNAME=["bot"] ```bash -# windows +# windows cmd set NICKNAME '["bot"]' +# windows powershell +$Env:NICKNAME='["bot"]' # linux/macOS export NICKNAME='["bot"]' ``` @@ -556,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='[".", " "]' @@ -594,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' ```