@@ -20,7 +20,7 @@ uninstall() {
2020
2121# Creates a backup of the global pnpm store directory
2222# Args:
23- # $1 - Path to the backup file (tar.xz format)
23+ # $1 - Path to the backup file (tar.gz format)
2424# Returns:
2525# 0 on success, 1 on failure
2626backup_pnpm_store () {
@@ -130,14 +130,14 @@ pnpm_install_unraid_api() {
130130 return 1
131131 fi
132132
133- local archive_file=" /boot/config/plugins/dynamix.unraid.net/node-modules/ node_modules.tar.xz "
133+ local archive_file=" /boot/config/plugins/dynamix.my.servers/ node_modules.tar.gz "
134134 local node_modules_dir=" ${unraid_api_dir} /node_modules"
135135
136136 # Check if archive exists and restore it
137137 if [ -f " $archive_file " ]; then
138138 echo " Found node_modules archive at '$archive_file '. Attempting to restore..."
139139 rm -rf " $node_modules_dir "
140- if tar -xJf " $archive_file " -C " $( dirname " $node_modules_dir " ) " --preserve-permissions; then
140+ if tar -xzf " $archive_file " -C " $( dirname " $node_modules_dir " ) " --preserve-permissions; then
141141 echo " Successfully restored node_modules from archive."
142142 return 0
143143 else
@@ -149,6 +149,7 @@ pnpm_install_unraid_api() {
149149 rm -rf " $node_modules_dir "
150150 # Run pnpm install in a subshell to prevent changing the current working directory of the script
151151 (cd " $unraid_api_dir " && run_pnpm_install)
152+ echo " ⚠️ Do not close this window yet"
152153 archive_node_modules
153154}
154155
@@ -158,8 +159,8 @@ pnpm_install_unraid_api() {
158159# 0 on success, 1 on failure
159160archive_node_modules () {
160161 local source_dir=" /usr/local/unraid-api/node_modules"
161- local dest_dir=" /boot/config/plugins/dynamix.unraid.net/node-modules "
162- local archive_file=" ${dest_dir} /node_modules.tar.xz "
162+ local dest_dir=" /boot/config/plugins/dynamix.my.servers "
163+ local archive_file=" ${dest_dir} /node_modules.tar.gz "
163164
164165 # Check if source directory exists
165166 if [ ! -d " $source_dir " ]; then
@@ -172,8 +173,8 @@ archive_node_modules() {
172173
173174 echo " Archiving node_modules from '$source_dir ' to '$archive_file '"
174175
175- # Create archive with xz compression, preserving symlinks
176- if tar -cJf " $archive_file " -C " $( dirname " $source_dir " ) " " $( basename " $source_dir " ) " ; then
176+ # Create archive with gzip compression level 1 (fastest) , preserving symlinks
177+ if tar -cf " $archive_file " -I " gzip -1 " -C " $( dirname " $source_dir " ) " " $( basename " $source_dir " ) " ; then
177178 echo " node_modules archive created successfully."
178179 else
179180 echo " Error: Failed to create node_modules archive."
0 commit comments