Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit e733a83

Browse files
authored
Unbreak install after repo transfers (#1523)
The directory name in the zip we download from github's release archive will be different now that the project was renamed. It may be renamed again in the future, so try to obtain the directory name from the zip. Fixes #1521
1 parent ccaa714 commit e733a83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/build_ngx_pagespeed.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ Not deleting $directory; name is suspiciously short. Something is wrong."
612612
nps_downloaded="$TEMPDIR/$nps_downloaded_fname.zip"
613613
status "Downloading ngx_pagespeed..."
614614
run wget "$nps_baseurl/$tag_name.zip" -O "$nps_downloaded"
615-
nps_module_dir="$BUILDDIR/$nps_downloaded_fname"
615+
# Read the directory name from the zip, the first line is expected to have it.
616+
nps_module_dir=$(unzip -qql "$nps_downloaded" | head -n1 | tr -s ' ' | cut -d' ' -f5-)
617+
nps_module_dir="$BUILDDIR/${nps_module_dir::-1}"
616618
delete_if_already_exists "$nps_module_dir"
617619
status "Extracting ngx_pagespeed..."
618620
run unzip -q "$nps_downloaded" -d "$BUILDDIR"

0 commit comments

Comments
 (0)