From fc18f1fa8d819a12aba632b24d9b9203406280af Mon Sep 17 00:00:00 2001 From: "T.C." Date: Sat, 17 May 2025 10:05:02 +0800 Subject: [PATCH] auto choosing command based on arch (#17) The script now is able to choose dify plugin cli command based on the CPU architecture. --- plugin_repackaging.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin_repackaging.sh b/plugin_repackaging.sh index a9d4173..70c3d43 100644 --- a/plugin_repackaging.sh +++ b/plugin_repackaging.sh @@ -13,6 +13,12 @@ CURR_DIR=`dirname $0` cd $CURR_DIR CURR_DIR=`pwd` USER=`whoami` +ARCH_NAME=`uname -m` + +CMD_NAME="dify-plugin-linux-amd64-5g" +if [[ "arm64" == "$ARCH_NAME" || "aarch64" == "$ARCH_NAME" ]]; then + CMD_NAME="dify-plugin-linux-arm64-5g" +fi market(){ if [[ -z "$2" || -z "$3" || -z "$4" ]]; then @@ -109,8 +115,8 @@ repackage(){ sed -i '/^wheels\//d' .difyignore fi cd ${CURR_DIR} - chmod 755 ${CURR_DIR}/dify-plugin-linux-amd64-5g - ${CURR_DIR}/dify-plugin-linux-amd64-5g plugin package ${CURR_DIR}/${PACKAGE_NAME} -o ${CURR_DIR}/${PACKAGE_NAME}-offline.difypkg + chmod 755 ${CURR_DIR}/${CMD_NAME} + ${CURR_DIR}/${CMD_NAME} plugin package ${CURR_DIR}/${PACKAGE_NAME} -o ${CURR_DIR}/${PACKAGE_NAME}-offline.difypkg echo "Repackage success." }