fix: Try .difyignore first, fallback to .gitignore if not found

This commit is contained in:
junjie.miao
2025-05-26 15:09:47 +08:00
parent 632447c652
commit 8173b91807

View File

@ -122,13 +122,16 @@ repackage(){
' requirements.txt ' requirements.txt
rm -f requirements.txt.bak rm -f requirements.txt.bak
fi fi
IGNORE_PATH=.difyignore
if [ -f .difyignore ]; then if [ ! -f "$IGNORE_PATH" ]; then
if [[ "linux" == "$OS_TYPE" ]]; then IGNORE_PATH=.gitignore
sed -i '/^wheels\//d' .difyignore fi
if [ -f "$IGNORE_PATH" ]; then
if [[ "linux" == "$OS_TYPE" ]]; then
sed -i '/^wheels\//d' "${IGNORE_PATH}"
elif [[ "darwin" == "$OS_TYPE" ]]; then elif [[ "darwin" == "$OS_TYPE" ]]; then
sed -i ".bak" '/^wheels\//d' .difyignore sed -i ".bak" '/^wheels\//d' "${IGNORE_PATH}"
rm -f .difyignore.bak rm -f "${IGNORE_PATH}.bak"
fi fi
fi fi
cd ${CURR_DIR} cd ${CURR_DIR}