Skip to content

Commit 6c21037

Browse files
committed
feat: copy only needed files for nodejs
1 parent 50351d0 commit 6c21037

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin/plugins/dynamix.unraid.net.plg

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,18 @@ sha256check() {
114114
NODE_FILE="&NODEJS_FILENAME;"
115115
<![CDATA[
116116
if [[ -f "/boot/config/plugins/dynamix.my.servers/${NODE_FILE}" ]]; then
117-
tar --strip-components=1 -xf /boot/config/plugins/dynamix.my.servers/${NODE_FILE} -C /usr/local/;
117+
TEMP_DIR=$(mktemp -d)
118+
tar -xf /boot/config/plugins/dynamix.my.servers/${NODE_FILE} -C ${TEMP_DIR};
119+
if cp -rf "${TEMP_DIR}"/bin/* /usr/local/bin/ && \
120+
cp -rf "${TEMP_DIR}"/lib/* /usr/local/lib/ && \
121+
cp -rf "${TEMP_DIR}"/include/* /usr/local/include/ && \
122+
cp -rf "${TEMP_DIR}"/share/* /usr/local/share/ then
123+
echo "Node.js installation successful"
124+
else
125+
echo "Failed to copy Node.js files"
126+
exit 1
127+
fi
118128
fi
119-
120129
exit 0;
121130
]]>
122131
</INLINE>

0 commit comments

Comments
 (0)