mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-24 20:51:06 +07:00
Wait in get till no processes are using the output filepath
This commit is contained in:
parent
449afbcaec
commit
80075aeba5
@ -89,6 +89,12 @@ get() {
|
|||||||
echo "Another process is downloading a file at $file_path, waiting"
|
echo "Another process is downloading a file at $file_path, waiting"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
if [ "$execute" = "-e" ]; then
|
||||||
|
until [ -z "$(fuser "$file_path" 2>/dev/null)" ]; do
|
||||||
|
echo "Waiting for other processes to stop using $file_path..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
fi
|
||||||
trap 'sudo rm -rf "$lock_path"' EXIT SIGINT SIGTERM
|
trap 'sudo rm -rf "$lock_path"' EXIT SIGINT SIGTERM
|
||||||
for link in "${links[@]}"; do
|
for link in "${links[@]}"; do
|
||||||
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
||||||
|
Loading…
Reference in New Issue
Block a user