Replace bintray with jsdelivr for scripts

This commit is contained in:
Shivam Mathur 2021-04-13 03:11:08 +05:30
parent 0741f2b23a
commit 86e7315da6
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -12,7 +12,7 @@ export composer_json="$HOME/.composer/composer.json"
export composer_lock="$HOME/.composer/composer.lock"
export latest="releases/latest/download"
export github="https://github.com/shivammathur"
export bintray="https://dl.bintray/shivammathur"
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
# Function to log start of a operation.
step_log() {
@ -73,12 +73,12 @@ get() {
fi
}
# Function to download and run scripts from GitHub releases with bintray fallback.
# Function to download and run scripts from GitHub releases with jsdeliver fallback.
run_script() {
repo=$1
shift
args=("$@")
get -q -e /tmp/install.sh "$github/$repo/$latest/install.sh" "$bintray/php/$repo.sh"
get -q -e /tmp/install.sh "$github/$repo/$latest/install.sh" "$jsdeliver/$1@main/scripts/install.sh"
bash /tmp/install.sh "${args[@]}"
}