chore: enhance debugging output in PR plugin generation scripts

- Added debug statements in `generate-pr-plugin.sh` to display the tarball path, backup directory, and list of files being processed, improving visibility during deployment.
- Updated `pr-plugin-build.yml` to include output of the file list and tarball contents, aiding in verification and troubleshooting during the build process.
This commit is contained in:
Eli Bosley
2025-09-10 12:30:03 -04:00
parent 8911531676
commit 6b1171a5fa
2 changed files with 19 additions and 4 deletions

View File

@@ -94,14 +94,19 @@ TARBALL="/boot/config/plugins/&name;/&tarball;"
MANIFEST="/boot/config/plugins/&name;/installed_files.txt"
echo "Starting file deployment..."
echo "Tarball: $TARBALL"
echo "Backup directory: $BACKUP_DIR"
# Clear manifest
> "$MANIFEST"
# Extract and get file list - use a temp file to avoid subshell issues
# Get file list first
tar -tzf "$TARBALL" > /tmp/plugin_files.txt
# Process each file
echo "Files in tarball:"
cat /tmp/plugin_files.txt
# Backup original files BEFORE extraction
while IFS= read -r file; do
# Skip directories
if [[ "$file" == */ ]]; then
@@ -112,13 +117,15 @@ while IFS= read -r file; do
# So the actual system path is /usr/local/emhttp/...
SYSTEM_FILE="/${file}"
# Check if file exists and backup
# Check if file exists and backup the ORIGINAL (before our changes)
echo "Processing file: $file -> $SYSTEM_FILE"
if [ -f "$SYSTEM_FILE" ]; then
BACKUP_FILE="$BACKUP_DIR/$(echo "$file" | tr '/' '_')"
echo "Backing up: $SYSTEM_FILE"
echo "Backing up original: $SYSTEM_FILE -> $BACKUP_FILE"
cp -p "$SYSTEM_FILE" "$BACKUP_FILE"
echo "$SYSTEM_FILE|$BACKUP_FILE" >> "$MANIFEST"
else
echo "New file: $SYSTEM_FILE"
echo "$SYSTEM_FILE|NEW" >> "$MANIFEST"
fi
done < /tmp/plugin_files.txt