diff --git a/.github/workflows/site_deploy.yml b/.github/workflows/site_deploy.yml index 48db972f..f44cb7eb 100644 --- a/.github/workflows/site_deploy.yml +++ b/.github/workflows/site_deploy.yml @@ -40,17 +40,22 @@ jobs: - name: Get Deploy Name if: github.event_name == 'push' - run: echo "DEPLOY_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV + run: | + echo "DEPLOY_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV + echo "PRODUCTION=${{ env.BRANCH_NAME == 'master' }}" >> $GITHUB_ENV + - name: Get Deploy Name if: github.event_name != 'push' - run: echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV + run: | + echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV + echo "PRODUCTION=false" >> $GITHUB_ENV - name: Deploy to Netlify uses: nwtgck/actions-netlify@v1.1 with: publish-dir: './docs/.vuepress/dist' - production-branch: master + production-deploy: ${{ env.PRODUCTION }} github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: 'Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}' enable-commit-comment: false diff --git a/archive/2.0.0a10/guide/installation.md b/archive/2.0.0a10/guide/installation.md index aaf916ec..54ab8588 100644 --- a/archive/2.0.0a10/guide/installation.md +++ b/archive/2.0.0a10/guide/installation.md @@ -71,6 +71,11 @@ pip install . # 不推荐 插件可以通过 `nb-cli` 进行安装,也可以自行安装并加载插件。 +:::warning 注意 +如果你想直接从nb-cli安装插件,请确保你的当前目录中含有能正常工作的bot.py! +安装完成后请重启当前bot.py(假如你在运行它的话)。 +::: + ```bash # 列出所有的插件 nb plugin list diff --git a/nonebot/__init__.py b/nonebot/__init__.py index efe6ed81..9c65b5a0 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -36,9 +36,14 @@ from nonebot.utils import escape_tag from nonebot.config import Env, Config from nonebot.log import logger, default_filter -_dist: pkg_resources.Distribution = pkg_resources.get_distribution("nonebot2") -__version__ = _dist.version -VERSION = _dist.parsed_version +try: + _dist: pkg_resources.Distribution = pkg_resources.get_distribution( + "nonebot2") + __version__ = _dist.version + VERSION = _dist.parsed_version +except pkg_resources.DistributionNotFound: + __version__ = None + VERSION = None _driver: Optional[Driver] = None