-
Couldn't load subscription status.
- Fork 11
chore: include node_modules in api slackware package #1415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
699b54f
bb9d56b
082b4b9
3392f08
c2c6ff3
0dff2cf
9312a02
7f5b876
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,6 @@ | |
| <!ENTITY txz_sha256 ""> | ||
| <!ENTITY txz_url ""> | ||
| <!ENTITY txz_name ""> | ||
| <!ENTITY vendor_store_url ""> | ||
| <!ENTITY vendor_store_filename ""> | ||
| <!ENTITY arch "x86_64"> | ||
| <!ENTITY build "1"> | ||
| <!ENTITY tag ""> | ||
|
|
@@ -47,10 +45,6 @@ exit 0 | |
| ]]> | ||
| </INLINE> | ||
| </FILE> | ||
|
|
||
| <FILE Name="/boot/config/plugins/dynamix.my.servers/&vendor_store_filename;"> | ||
| <URL>&vendor_store_url;</URL> | ||
| </FILE> | ||
|
|
||
| <!-- download main txz --> | ||
| <FILE Name="&source;"> | ||
|
|
@@ -223,7 +217,6 @@ exit 0 | |
| PKG_FILE="&source;" # Full path to the package file including .txz extension | ||
| PKG_URL="&txz_url;" # URL where package was downloaded from | ||
| PKG_NAME="&txz_name;" # Name of the package file | ||
| VENDOR_ARCHIVE="/boot/config/plugins/dynamix.my.servers/&vendor_store_filename;" | ||
| <![CDATA[ | ||
| # Install the Slackware package | ||
| echo "Installing package..." | ||
|
|
@@ -235,6 +228,9 @@ for txz_file in /boot/config/plugins/dynamix.my.servers/dynamix.unraid.net-*.txz | |
| fi | ||
| done | ||
|
|
||
| # Clean up any old node_modules archives (on the boot drive) that don't match our current version | ||
| /etc/rc.d/rc.unraid-api cleanup-dependencies | ||
|
|
||
|
Comment on lines
+231
to
+233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Guard
-# Clean up any old node_modules archives (on the boot drive) that don't match our current version
-/etc/rc.d/rc.unraid-api cleanup-dependencies
+# Clean up any old node_modules archives (on the boot drive) that don't match our current version
+if [ -x "/etc/rc.d/rc.unraid-api" ]; then
+ /etc/rc.d/rc.unraid-api cleanup-dependencies || \
+ echo "⚠️ Dependency cleanup failed, continuing install anyway"
+else
+ echo "⚠️ /etc/rc.d/rc.unraid-api not found or not executable, skipping dependency cleanup"
+fiMinimal defensive code prevents broken upgrades on edge systems without adding much complexity. 🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is bundled with the plugin, so it will always exist There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pujitm Got it—since the plugin ships its own If you’re comfortable relying on that guarantee, feel free to keep the current line as-is. For belt-and-suspenders robustness you could still echo a warning when the cleanup command itself returns non-zero, but that’s purely optional: # Optional: surface a failure while still proceeding
/etc/rc.d/rc.unraid-api cleanup-dependencies || \
echo "⚠️ Dependency cleanup failed (non-zero exit), continuing install"Totally fine to leave it out if you’d rather keep things concise. Let me know if you’d like me to drop the suggestion entirely. ✏️ Learnings added
|
||
| # Remove existing node_modules directory | ||
| echo "Cleaning up existing node_modules directory..." | ||
| if [ -d "/usr/local/unraid-api/node_modules" ]; then | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.