optimize github repo

This commit is contained in:
junjie.miao
2025-03-17 16:00:11 +08:00
parent c30962ecf1
commit 0aca775309
3 changed files with 7 additions and 3 deletions

View File

@ -20,7 +20,7 @@ sh plugin_repackaging.sh market junjiem mcp_sse 0.0.1
![github](images/github.png)
```shell
sh plugin_repackaging.sh github https://github.com/junjiem/dify-plugin-agent-mcp_sse 0.0.1 agent-mcp_see.difypkg
sh plugin_repackaging.sh github junjiem/dify-plugin-agent-mcp_sse 0.0.1 agent-mcp_see.difypkg
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,6 +1,7 @@
#!/bin/bash
# author: Junjie.M
GITHUB_API_URL=https://github.com
MARKETPLACE_API_URL=https://marketplace.dify.ai
PIP_MIRROR_URL=https://mirrors.aliyun.com/pypi/simple
@ -29,13 +30,16 @@ github(){
echo ""
echo "Usage: "$0" github [Github repo] [Release title] [Assets name (include .difypkg suffix)]"
echo "Example:"
echo " "$0" github https://github.com/junjiem/dify-plugin-tools-dbquery v0.0.2 db_query.difypkg"
echo " "$0" github junjiem/dify-plugin-tools-dbquery v0.0.2 db_query.difypkg"
echo " "$0" github https://github.com/junjiem/dify-plugin-agent-mcp_sse 0.0.1 agent-mcp_see.difypkg"
echo ""
exit 3
fi
echo "From the Github downloading ..."
GITHUB_REPO=$2
if [[ "${GITHUB_REPO}" != "${GITHUB_API_URL}"* ]]; then
GITHUB_REPO="${GITHUB_API_URL}/${GITHUB_REPO}"
fi
RELEASE_TITLE=$3
ASSETS_NAME=$4
PLUGIN_NAME="${ASSETS_NAME%.difypkg}"
@ -49,7 +53,7 @@ repackage(){
local PLUGIN_ALL_NAME=$1
local PLUGIN_PACKAGE_NAME=$2
local PLUGIN_DOWNLOAD_URL=$3
echo "Download ${PLUGIN_PACKAGE_NAME} ..."
echo "Download ${PLUGIN_DOWNLOAD_URL} ..."
curl -L -o ./${PLUGIN_PACKAGE_NAME} ${PLUGIN_DOWNLOAD_URL}
if [[ $? -ne 0 ]]; then
echo "Download failed, please check the plugin author, name and version."