Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ RUN echo "deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free
echo "deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list

# 安装必要的工具
RUN apt-get update && \
apt-get install -y curl unzip && \
rm -rf /var/lib/apt/lists/*
# 安装构建工具(关键)
RUN apt-get update && apt-get install -y \
curl unzip dos2unix \
gcc g++ make \
build-essential pkg-config \
libcairo2 libcairo2-dev \
libpango1.0-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制所有文件到容器中
COPY . .

# 给脚本添加执行权限
RUN chmod +x plugin_repackaging.sh
# 修复 CRLF
RUN dos2unix /app/plugin_repackaging.sh && \
chmod +x /app/plugin_repackaging.sh

# 设置默认命令
CMD ["./plugin_repackaging.sh", "-p", "manylinux_2_17_x86_64", "market", "antv", "visualization", "0.1.7"]
ENTRYPOINT ["bash", "/app/plugin_repackaging.sh"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

ENTRYPOINT reduces container flexibility.

Changing from CMD to ENTRYPOINT means users can no longer easily override the default command (as shown in README section 4). To run alternative commands, users must now use docker run --entrypoint <cmd>, which is less convenient.

Consider whether the added rigidity is worth the trade-off, or document the --entrypoint override pattern.

🔎 Alternative approach

If you want to keep the bash invocation while preserving easy override:

-ENTRYPOINT ["bash", "/app/plugin_repackaging.sh"]
+CMD ["bash", "/app/plugin_repackaging.sh"]

Or if ENTRYPOINT is preferred, update README section 4 to show the correct override syntax:

docker run --entrypoint bash -v $(pwd):/app dify-plugin-repackaging /app/plugin_repackaging.sh -p manylinux_2_17_x86_64 market antv visualization 0.1.7
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ENTRYPOINT ["bash", "/app/plugin_repackaging.sh"]
CMD ["bash", "/app/plugin_repackaging.sh"]
🤖 Prompt for AI Agents
In @Dockerfile at line 27, The Dockerfile uses ENTRYPOINT ["bash",
"/app/plugin_repackaging.sh"] which prevents users from easily overriding the
default command; either revert to CMD ["bash", "/app/plugin_repackaging.sh"] to
allow simple docker run overrides, or keep ENTRYPOINT but update README section
4 to show the proper override syntax using --entrypoint (e.g., docker run
--entrypoint bash ... /app/plugin_repackaging.sh ...); choose one approach and
apply it consistently (modify the Dockerfile ENTRYPOINT/CMD accordingly and/or
update README section 4) so users can run alternative commands as intended.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ docker run -v $(pwd):/app dify-plugin-repackaging
windows
```cmd
docker run -v %cd%:/app dify-plugin-repackaging
本地示例
docker run -v %cd%:/work -v %cd%/output:/app/output dify-plugin-repackaging local /work/langgenius-modelscope_0.0.8.difypkg
Comment on lines +25 to +26
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the volume mount path inconsistency.

The example mounts the current directory to /work, but the Dockerfile sets WORKDIR /app and the script runs from /app. When you reference /work/langgenius-modelscope_0.0.8.difypkg, the script won't find it because it operates relative to /app, not /work.

🔎 Proposed fix
-本地示例
-docker run -v %cd%:/work -v %cd%/output:/app/output dify-plugin-repackaging local /work/langgenius-modelscope_0.0.8.difypkg
+本地示例
+docker run -v %cd%:/app -v %cd%/output:/app/output dify-plugin-repackaging local /app/langgenius-modelscope_0.0.8.difypkg

This ensures the current directory is mounted to /app (matching the WORKDIR), and the plugin file path is relative to /app.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
本地示例
docker run -v %cd%:/work -v %cd%/output:/app/output dify-plugin-repackaging local /work/langgenius-modelscope_0.0.8.difypkg
本地示例
docker run -v %cd%:/app -v %cd%/output:/app/output dify-plugin-repackaging local /app/langgenius-modelscope_0.0.8.difypkg
🤖 Prompt for AI Agents
In @README.md around lines 25 - 26, Update the example Docker run command so the
host current directory is mounted to /app (matching the Dockerfile's WORKDIR and
where the script runs) and reference the plugin file path relative to /app;
change the mount target from /work to /app and update the file path from
/work/langgenius-modelscope_0.0.8.difypkg to
/app/langgenius-modelscope_0.0.8.difypkg so the container can find the file when
the script runs from /app.

```
4.override CMD(opt)

Expand Down
268 changes: 120 additions & 148 deletions plugin_repackaging.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# author: Junjie.M
# author: Junjie.M (modified by ChatGPT)

DEFAULT_GITHUB_API_URL=https://github.com
DEFAULT_MARKETPLACE_API_URL=https://marketplace.dify.ai
Expand All @@ -12,183 +12,155 @@ PIP_MIRROR_URL="${PIP_MIRROR_URL:-$DEFAULT_PIP_MIRROR_URL}"
CURR_DIR=`dirname $0`
cd $CURR_DIR
CURR_DIR=`pwd`

# 强制使用 /app/output 作为输出目录
OUTPUT_DIR="/app/output"
mkdir -p "$OUTPUT_DIR"

USER=`whoami`
ARCH_NAME=`uname -m`
OS_TYPE=$(uname)
OS_TYPE=$(echo "$OS_TYPE" | tr '[:upper:]' '[:lower:]')
OS_TYPE=$(uname | tr '[:upper:]' '[:lower:]')

CMD_NAME="dify-plugin-${OS_TYPE}-amd64"
if [[ "arm64" == "$ARCH_NAME" || "aarch64" == "$ARCH_NAME" ]]; then
CMD_NAME="dify-plugin-${OS_TYPE}-arm64"
if [[ "$ARCH_NAME" == "arm64" || "$ARCH_NAME" == "aarch64" ]]; then
CMD_NAME="dify-plugin-${OS_TYPE}-arm64"
fi

PIP_PLATFORM=""
PACKAGE_SUFFIX="offline"

market(){
if [[ -z "$2" || -z "$3" || -z "$4" ]]; then
echo ""
echo "Usage: "$0" market [plugin author] [plugin name] [plugin version]"
echo "Example:"
echo " "$0" market junjiem mcp_sse 0.0.1"
echo " "$0" market langgenius agent 0.0.9"
echo ""
exit 1
fi
echo "From the Dify Marketplace downloading ..."
PLUGIN_AUTHOR=$2
PLUGIN_NAME=$3
PLUGIN_VERSION=$4
PLUGIN_PACKAGE_PATH=${CURR_DIR}/${PLUGIN_AUTHOR}-${PLUGIN_NAME}_${PLUGIN_VERSION}.difypkg
PLUGIN_DOWNLOAD_URL=${MARKETPLACE_API_URL}/api/v1/plugins/${PLUGIN_AUTHOR}/${PLUGIN_NAME}/${PLUGIN_VERSION}/download
echo "Downloading ${PLUGIN_DOWNLOAD_URL} ..."
curl -L -o ${PLUGIN_PACKAGE_PATH} ${PLUGIN_DOWNLOAD_URL}
if [[ $? -ne 0 ]]; then
echo "Download failed, please check the plugin author, name and version."
exit 1
fi
echo "Download success."
repackage ${PLUGIN_PACKAGE_PATH}
if [[ -z "$2" || -z "$3" || -z "$4" ]]; then
echo ""
echo "Usage: $0 market [plugin author] [plugin name] [plugin version]"
exit 1
fi
echo "From Dify Marketplace downloading ..."
PLUGIN_AUTHOR=$2
PLUGIN_NAME=$3
PLUGIN_VERSION=$4
PACKAGE_PATH="${CURR_DIR}/${PLUGIN_AUTHOR}-${PLUGIN_NAME}_${PLUGIN_VERSION}.difypkg"
URL="${MARKETPLACE_API_URL}/api/v1/plugins/${PLUGIN_AUTHOR}/${PLUGIN_NAME}/${PLUGIN_VERSION}/download"

curl -L -o "$PACKAGE_PATH" "$URL"
if [[ $? -ne 0 ]]; then
echo "Download failed."
exit 1
fi
repackage "$PACKAGE_PATH"
}

github(){
if [[ -z "$2" || -z "$3" || -z "$4" ]]; then
echo ""
echo "Usage: "$0" github [Github repo] [Release title] [Assets name (include .difypkg suffix)]"
echo "Example:"
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 1
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}"
PLUGIN_PACKAGE_PATH=${CURR_DIR}/${PLUGIN_NAME}-${RELEASE_TITLE}.difypkg
PLUGIN_DOWNLOAD_URL=${GITHUB_REPO}/releases/download/${RELEASE_TITLE}/${ASSETS_NAME}
echo "Downloading ${PLUGIN_DOWNLOAD_URL} ..."
curl -L -o ${PLUGIN_PACKAGE_PATH} ${PLUGIN_DOWNLOAD_URL}
if [[ $? -ne 0 ]]; then
echo "Download failed, please check the github repo, release title and assets name."
exit 1
fi
echo "Download success."
repackage ${PLUGIN_PACKAGE_PATH}
if [[ -z "$2" || -z "$3" || -z "$4" ]]; then
echo ""
echo "Usage: $0 github [repo] [release] [asset]"
exit 1
fi
echo "From Github downloading ..."
REPO=$2
[[ "$REPO" != "$GITHUB_API_URL"* ]] && REPO="${GITHUB_API_URL}/${REPO}"
RELEASE=$3
ASSET=$4
NAME="${ASSET%.difypkg}"
PACKAGE_PATH="${CURR_DIR}/${NAME}-${RELEASE}.difypkg"
URL="${REPO}/releases/download/${RELEASE}/${ASSET}"

curl -L -o "$PACKAGE_PATH" "$URL"
if [[ $? -ne 0 ]]; then
echo "Download failed."
exit 1
fi
repackage "$PACKAGE_PATH"
}

_local(){
echo $2
if [[ -z "$2" ]]; then
echo ""
echo "Usage: "$0" local [difypkg path]"
echo "Example:"
echo " "$0" local ./db_query.difypkg"
echo " "$0" local /root/dify-plugin/db_query.difypkg"
echo ""
exit 1
fi
PLUGIN_PACKAGE_PATH=`realpath $2`
repackage ${PLUGIN_PACKAGE_PATH}
if [[ -z "$2" ]]; then
echo "Usage: $0 local [difypkg path]"
exit 1
fi
REAL_PATH=$(realpath "$2")
repackage "$REAL_PATH"
}

repackage(){
local PACKAGE_PATH=$1
PACKAGE_NAME_WITH_EXTENSION=`basename ${PACKAGE_PATH}`
PACKAGE_NAME="${PACKAGE_NAME_WITH_EXTENSION%.*}"
echo "Unziping ..."
install_unzip
unzip -o ${PACKAGE_PATH} -d ${CURR_DIR}/${PACKAGE_NAME}
if [[ $? -ne 0 ]]; then
echo "Unzip failed."
exit 1
fi
echo "Unzip success."
echo "Repackaging ..."
cd ${CURR_DIR}/${PACKAGE_NAME}
pip download ${PIP_PLATFORM} -r requirements.txt -d ./wheels --index-url ${PIP_MIRROR_URL} --trusted-host mirrors.aliyun.com
if [[ $? -ne 0 ]]; then
echo "Pip download failed."
exit 1
fi
if [[ "linux" == "$OS_TYPE" ]]; then
sed -i '1i\--no-index --find-links=./wheels/' requirements.txt
elif [[ "darwin" == "$OS_TYPE" ]]; then
sed -i ".bak" '1i\
--no-index --find-links=./wheels/
' requirements.txt
rm -f requirements.txt.bak
fi
IGNORE_PATH=.difyignore
if [ ! -f "$IGNORE_PATH" ]; then
IGNORE_PATH=.gitignore
fi
if [ -f "$IGNORE_PATH" ]; then
if [[ "linux" == "$OS_TYPE" ]]; then
sed -i '/^wheels\//d' "${IGNORE_PATH}"
elif [[ "darwin" == "$OS_TYPE" ]]; then
sed -i ".bak" '/^wheels\//d' "${IGNORE_PATH}"
rm -f "${IGNORE_PATH}.bak"
fi
fi
cd ${CURR_DIR}
chmod 755 ${CURR_DIR}/${CMD_NAME}
${CURR_DIR}/${CMD_NAME} plugin package ${CURR_DIR}/${PACKAGE_NAME} -o ${CURR_DIR}/${PACKAGE_NAME}-${PACKAGE_SUFFIX}.difypkg --max-size 5120
if [ $? -ne 0 ]; then
echo "Repackage failed."
exit 1
fi
echo "Repackage success."
local PKG_PATH=$1
local PKG_FULL=$(basename "$PKG_PATH")
local PKG_NAME="${PKG_FULL%.*}"
Comment on lines +87 to +88
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Separate variable declaration from assignment.

Combining local declaration with command substitution can mask the exit status of the command, making error detection unreliable.

🔎 Proposed fix
     local PKG_PATH=$1
-    local PKG_FULL=$(basename "$PKG_PATH")
-    local PKG_NAME="${PKG_FULL%.*}"
+    local PKG_FULL
+    PKG_FULL=$(basename "$PKG_PATH")
+    local PKG_NAME="${PKG_FULL%.*}"

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
local PKG_FULL=$(basename "$PKG_PATH")
local PKG_NAME="${PKG_FULL%.*}"
local PKG_FULL
PKG_FULL=$(basename "$PKG_PATH")
local PKG_NAME="${PKG_FULL%.*}"
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 87-87: Declare and assign separately to avoid masking return values.

(SC2155)

🤖 Prompt for AI Agents
In @plugin_repackaging.sh around lines 87 - 88, The combined local declarations
with command substitution for PKG_FULL and PKG_NAME can mask the exit status of
the command substitution; change to declare variables first (local PKG_FULL
PKG_NAME) and then assign PKG_FULL="$(basename "$PKG_PATH")" and
PKG_NAME="${PKG_FULL%.*}" so any failure in basename or downstream assignments
is detectable and the exit code is preserved; update the block that references
PKG_PATH, PKG_FULL, and PKG_NAME accordingly.


echo "Unziping ..."
install_unzip
unzip -o "$PKG_PATH" -d "${CURR_DIR}/${PKG_NAME}"
[[ $? -ne 0 ]] && echo "Unzip failed." && exit 1

echo "Repackaging ..."
cd "${CURR_DIR}/${PKG_NAME}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add error handling for directory change.

The cd command can fail if the directory doesn't exist or isn't accessible. Add error handling to prevent the script from continuing in the wrong directory.

🔎 Proposed fix
-    cd "${CURR_DIR}/${PKG_NAME}"
+    cd "${CURR_DIR}/${PKG_NAME}" || { echo "Failed to enter package directory."; exit 1; }

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd "${CURR_DIR}/${PKG_NAME}"
cd "${CURR_DIR}/${PKG_NAME}" || { echo "Failed to enter package directory."; exit 1; }
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 96-96: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In @plugin_repackaging.sh at line 96, The cd command invocation cd
"${CURR_DIR}/${PKG_NAME}" can fail and leave the script in the wrong directory;
before changing directories, validate the target exists and is accessible (e.g.,
test -d and test -x) and after attempting the cd check its exit status and abort
(exit non-zero) or handle the failure (log and return) if it fails; update the
invocation of cd "${CURR_DIR}/${PKG_NAME}" to perform these checks and fail fast
so the script does not continue when the directory change fails.


pip download ${PIP_PLATFORM} -r requirements.txt -d ./wheels --index-url "${PIP_MIRROR_URL}" --trusted-host mirrors.aliyun.com
[[ $? -ne 0 ]] && echo "Pip download failed." && exit 1

if [[ "$OS_TYPE" == "linux" ]]; then
sed -i '1i\--no-index --find-links=./wheels/' requirements.txt
else
sed -i ".bak" '1i\
--no-index --find-links=./wheels/' requirements.txt
rm -f requirements.txt.bak
fi

# 修复 ignore
IGNORE_FILE=".difyignore"
[[ ! -f "$IGNORE_FILE" ]] && IGNORE_FILE=".gitignore"

if [[ -f "$IGNORE_FILE" ]]; then
if [[ "$OS_TYPE" == "linux" ]]; then
sed -i '/^wheels\//d' "$IGNORE_FILE"
else
sed -i ".bak" '/^wheels\//d' "$IGNORE_FILE"
rm -f "$IGNORE_FILE.bak"
fi
fi

cd "$CURR_DIR"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add error handling for directory change.

The cd back to CURR_DIR should verify success to ensure subsequent commands run in the correct location.

🔎 Proposed fix
-    cd "$CURR_DIR"
+    cd "$CURR_DIR" || { echo "Failed to return to working directory."; exit 1; }

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd "$CURR_DIR"
cd "$CURR_DIR" || { echo "Failed to return to working directory."; exit 1; }
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 122-122: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In @plugin_repackaging.sh at line 122, The script blindly runs cd "$CURR_DIR"
which can fail and leave subsequent commands running in the wrong directory;
update the call that returns to CURR_DIR to check the command result and handle
failures (e.g., test the exit status of cd "$CURR_DIR" and on failure log an
error including CURR_DIR and exit non‑zero or abort the script). Locate the cd
"$CURR_DIR" invocation and wrap it with a conditional check that emits a clear
error message and exits when the directory change fails.

chmod 755 "${CURR_DIR}/${CMD_NAME}"

# 这里改了!输出现在写到 /app/output
OUTPUT_FILE="${OUTPUT_DIR}/${PKG_NAME}-${PACKAGE_SUFFIX}.difypkg"
echo "Output => ${OUTPUT_FILE}"

"${CURR_DIR}/${CMD_NAME}" plugin package "${CURR_DIR}/${PKG_NAME}" -o "${OUTPUT_FILE}" --max-size 5120

[[ $? -ne 0 ]] && echo "Repackage failed." && exit 1

echo "Repackage success."
echo "Your output file is here:"
echo "👉 ${OUTPUT_FILE}"
}

install_unzip(){
if ! command -v unzip &> /dev/null; then
echo "Installing unzip ..."
yum -y install unzip
if [ $? -ne 0 ]; then
echo "Install unzip failed."
exit 1
fi
fi
if ! command -v unzip >/dev/null; then
echo "Installing unzip ..."
yum -y install unzip || { echo "Install unzip failed."; exit 1; }
fi
}

print_usage() {
echo "usage: $0 [-p platform] [-s package_suffix] {market|github|local}"
echo "-p platform: python packages' platform. Using for crossing repacking.
For example: -p manylinux2014_x86_64 or -p manylinux2014_aarch64"
echo "-s package_suffix: The suffix name of the output offline package.
For example: -s linux-amd64 or -s linux-arm64"
exit 1
print_usage(){
echo "usage: $0 [-p platform] [-s suffix] {market|github|local}"
exit 1
}

while getopts "p:s:" opt; do
case "$opt" in
p) PIP_PLATFORM="--platform ${OPTARG} --only-binary=:all:" ;;
s) PACKAGE_SUFFIX="${OPTARG}" ;;
*) print_usage; exit 1 ;;
esac
case "$opt" in
p) PIP_PLATFORM="--platform ${OPTARG} --only-binary=:all:" ;;
s) PACKAGE_SUFFIX="${OPTARG}" ;;
*) print_usage ;;
esac
done

shift $((OPTIND - 1))

echo "$1"
case "$1" in
'market')
market $@
;;
'github')
github $@
;;
'local')
_local $@
;;
*)

print_usage
exit 1
market) market $@ ;;
github) github $@ ;;
local) _local $@ ;;
*) print_usage ;;
esac
Comment on lines 159 to 164
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Quote array expansions to preserve arguments correctly.

The unquoted $@ can cause word splitting and globbing issues when arguments contain spaces or special characters. Use "$@" to preserve argument boundaries.

🔎 Proposed fix
 shift $((OPTIND - 1))
 case "$1" in
-    market) market $@ ;;
-    github) github $@ ;;
-    local)  _local $@ ;;
+    market) market "$@" ;;
+    github) github "$@" ;;
+    local)  _local "$@" ;;
     *) print_usage ;;
 esac

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case "$1" in
'market')
market $@
;;
'github')
github $@
;;
'local')
_local $@
;;
*)
print_usage
exit 1
market) market $@ ;;
github) github $@ ;;
local) _local $@ ;;
*) print_usage ;;
esac
case "$1" in
market) market "$@" ;;
github) github "$@" ;;
local) _local "$@" ;;
*) print_usage ;;
esac
🧰 Tools
🪛 Shellcheck (0.11.0)

[error] 160-160: Double quote array expansions to avoid re-splitting elements.

(SC2068)


[error] 161-161: Double quote array expansions to avoid re-splitting elements.

(SC2068)


[error] 162-162: Double quote array expansions to avoid re-splitting elements.

(SC2068)

🤖 Prompt for AI Agents
In @plugin_repackaging.sh around lines 159 - 164, The case branch calls use
unquoted $@ which allows word-splitting/globbing; update the dispatcher to pass
arguments as "$@" to preserve argument boundaries—change the invocations of
market, github, and _local from market $@, github $@, _local $@ to market "$@",
github "$@", and _local "$@", leaving the default print_usage branch unchanged.


exit 0