mirror of
https://github.com/unraid/api.git
synced 2026-01-01 14:10:10 -06:00
fix: node_modules dir removed on plugin update (#1406)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Improved installation process by automatically cleaning up old package directories before installing or upgrading the package. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -235,6 +235,13 @@ for txz_file in /boot/config/plugins/dynamix.my.servers/dynamix.unraid.net-*.txz
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Remove existing node_modules directory
|
||||||
|
echo "Cleaning up existing node_modules directory..."
|
||||||
|
if [ -d "/usr/local/unraid-api/node_modules" ]; then
|
||||||
|
echo "Removing: /usr/local/unraid-api/node_modules"
|
||||||
|
rm -rf "/usr/local/unraid-api/node_modules"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install the package using the explicit file path
|
# Install the package using the explicit file path
|
||||||
upgradepkg --install-new --reinstall "${PKG_FILE}"
|
upgradepkg --install-new --reinstall "${PKG_FILE}"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user