summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2018-07-25 16:44:12 -0700
committerJoel Fernandes (Google) <joel@joelfernandes.org>2018-07-25 16:44:48 -0700
commitdb9005f3443de61396189c3803b40f80b79fd2a1 (patch)
treebf3935e3ff2da7775029005631ecfad09f06096b
parent387c895c1803006bc6fa7b303c65ee53f8526d63 (diff)
downloadadeb-db9005f3443de61396189c3803b40f80b79fd2a1.tar.gz
Disable automatic downloads
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
-rw-r--r--README.md7
-rwxr-xr-xandrodeb14
2 files changed, 19 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9f326e2..d4e5655 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,13 @@ cd adeb
# Add some short cuts:
sudo ln -s $(pwd)/adeb /usr/bin/adeb
+
+# For cached image downloads which result in a huge speed-up,
+# You could set the ADEB_REPO_URL environment variable in your
+# bashrc file.
+# Disclaimer: Google is not liable for the below URL and this
+# is just an example.
+export ADEB_REPO_URL="github.com/joelagnel/"
```
* Installing adeb onto your device:
diff --git a/androdeb b/androdeb
index 9c7d4a5..9d343aa 100755
--- a/androdeb
+++ b/androdeb
@@ -225,8 +225,18 @@ if [ $DOWNLOAD -eq 1 ]; then
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