fix compile
This commit is contained in:
@@ -117,10 +117,18 @@ fetch_source() {
|
|||||||
echo " Extracting $filename..."
|
echo " Extracting $filename..."
|
||||||
case "$filename" in
|
case "$filename" in
|
||||||
*.zip)
|
*.zip)
|
||||||
unzip -q "$filepath" -d "$TMP_DIR"
|
unzip -q "$filepath" -d "$src_dir"
|
||||||
local extracted
|
# If the zip extracted into a single subdirectory, flatten it
|
||||||
extracted=$(unzip -qql "$filepath" | head -n1 | awk '{print $NF}' | cut -d/ -f1)
|
local contents
|
||||||
mv "$TMP_DIR/$extracted" "$src_dir"
|
contents=$(ls -1 "$src_dir")
|
||||||
|
local count
|
||||||
|
count=$(echo "$contents" | wc -l)
|
||||||
|
if [ "$count" -eq 1 ] && [ -d "$src_dir/$contents" ]; then
|
||||||
|
echo " Descending into $contents..."
|
||||||
|
local inner="$src_dir/$contents"
|
||||||
|
mv "$inner"/* "$src_dir/"
|
||||||
|
rmdir "$inner"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*.tar.gz|*.tgz)
|
*.tar.gz|*.tgz)
|
||||||
tar -xzf "$filepath" -C "$src_dir" --strip-components=1
|
tar -xzf "$filepath" -C "$src_dir" --strip-components=1
|
||||||
|
|||||||
Reference in New Issue
Block a user