Disable automatic downloads
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
diff --git a/androdeb b/androdeb
index 9c7d4a5..9d343aa 100755
--- a/androdeb
+++ b/androdeb
@@ -225,8 +225,18 @@
c_info "Downloading Androdeb from the web..."; c_info ""
# Github dropped tar gz support! ##?#??#! Now we've to zip everything.
- curl -L https://github.com/joelagnel/adeb/releases/download/$VERSION/$FNAME --output $TDIR_ABS/$FNAME
- unzip -e $TDIR_ABS/$FNAME -d $TDIR_ABS/
+ if [ -z $ADEB_REPO_URL ]; then
+ c_warning "Automatic download is disabled. To enable it, please set the \$ADEB_REPO_URL"
+ c_warning "environment variable as recommended in the setup instructions in the README.md"
+ do_cleanup
+ exit 0
+ fi
+
+ curl -L https://$ADEB_REPO_URL/adeb/releases/download/$VERSION/$FNAME --output $TDIR_ABS/$FNAME ||
+ die 9 "Failed to download adeb release."
+
+ unzip -e $TDIR_ABS/$FNAME -d $TDIR_ABS/ ||
+ die 10 "Failed to download adeb release. Double check the ADEB_REPO_URL value."
TARF=$TDIR_ABS/$FNAME_UZ
fi