mirror of
https://github.com/unraid/webgui.git
synced 2025-12-30 22:20:23 -06:00
chore: improve PR plugin script and update UI for testing
- Added error handling and improved variable handling in `generate-pr-plugin.sh`. - Updated placeholder values in the generated plugin file for clarity. - Enhanced the UI in `Plugins.page` to indicate that the page is modified for PR testing.
This commit is contained in:
20
.github/scripts/generate-pr-plugin.sh
vendored
20
.github/scripts/generate-pr-plugin.sh
vendored
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Generate PR plugin file for Unraid
|
||||
# Usage: ./generate-pr-plugin.sh <version> <pr_number> <commit_sha> <tarball_name> <txz_url>
|
||||
@@ -55,9 +57,9 @@ cat > "$PLUGIN_NAME" << 'EOF'
|
||||
echo "===================================="
|
||||
echo "WebGUI PR Test Plugin Installation"
|
||||
echo "===================================="
|
||||
echo "Version: &version;"
|
||||
echo "PR: #≺"
|
||||
echo "Commit: &commit;"
|
||||
echo "Version: VERSION_PLACEHOLDER"
|
||||
echo "PR: #PR_PLACEHOLDER"
|
||||
echo "Commit: COMMIT_PLACEHOLDER"
|
||||
echo ""
|
||||
|
||||
# Create directories
|
||||
@@ -88,8 +90,8 @@ echo "Starting file deployment..."
|
||||
# Clear manifest
|
||||
> "$MANIFEST"
|
||||
|
||||
# Extract and get file list
|
||||
tar -tzf "$TARBALL" | while read -r file; do
|
||||
# Extract and get file list - use process substitution to avoid subshell
|
||||
while IFS= read -r file; do
|
||||
# Skip directories
|
||||
if [[ "$file" == */ ]]; then
|
||||
continue
|
||||
@@ -108,7 +110,7 @@ tar -tzf "$TARBALL" | while read -r file; do
|
||||
else
|
||||
echo "$SYSTEM_FILE|NEW" >> "$MANIFEST"
|
||||
fi
|
||||
done
|
||||
done < <(tar -tzf "$TARBALL")
|
||||
|
||||
# Extract the tarball to root (files are already prefixed with usr/local/)
|
||||
echo ""
|
||||
@@ -119,12 +121,12 @@ echo ""
|
||||
echo "✅ Installation complete!"
|
||||
echo ""
|
||||
echo "The following files have been deployed:"
|
||||
cat "$MANIFEST" | cut -d'|' -f1 | while read -r file; do
|
||||
while IFS='|' read -r file backup; do
|
||||
echo " - $file"
|
||||
done
|
||||
done < "$MANIFEST"
|
||||
|
||||
echo ""
|
||||
echo "⚠️ This is a TEST plugin for PR #≺"
|
||||
echo "⚠️ This is a TEST plugin for PR #PR_PLACEHOLDER"
|
||||
echo "⚠️ Remove this plugin before applying production updates"
|
||||
]]>
|
||||
</INLINE>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Menu="Tasks:50"
|
||||
Type="xmenu"
|
||||
Title="Installed Plugins (PR Test)"
|
||||
Title="Installed Plugins (PR TEST BUILD)"
|
||||
Tag="icon-plugins"
|
||||
Tabs="true"
|
||||
Code="e944"
|
||||
@@ -151,6 +151,10 @@ $(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
<div style="background-color:#ff8c2f;color:white;padding:15px;margin:10px 0;border-radius:5px;font-weight:bold;text-align:center;font-size:16px">
|
||||
⚠️ PR TEST BUILD - This page has been modified for testing pull request changes
|
||||
</div>
|
||||
|
||||
<div class="TableContainer">
|
||||
<table class='unraid tablesorter plugins shift' id='plugin_table'>
|
||||
<thead>
|
||||
|
||||
Reference in New Issue
Block a user