summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Musso <hashar@free.fr>2021-05-12 21:07:26 +0200
committerAntoine Musso <hashar@free.fr>2021-05-12 21:10:26 +0200
commit269a0f3f5590f918332eb1e84f39537a651b6ca7 (patch)
treec1addba6cf5cbdfc71acc226b0dc2d79267b0d61
parentb23b7e82936f37e76e352e70ea15b5afbd8e319e (diff)
download_bower: download to GERRIT_CACHE_HOME
Similar to Ie4fac83928527e0e71b159b9500983234c2261ac which lets one relocate download_file.py downloaded artifacts by setting the `GERRIT_CACHE_HOME` environment variable. The default behavior is unchanged. Change-Id: I9e223acff29ed4da6fda39589282a107420b9795
-rwxr-xr-xtools/js/download_bower.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/js/download_bower.py b/tools/js/download_bower.py
index 1df4b826bc..d541b565a9 100755
--- a/tools/js/download_bower.py
+++ b/tools/js/download_bower.py
@@ -25,8 +25,12 @@ import sys
import bowerutil
-CACHE_DIR = os.path.expanduser(os.path.join(
- '~', '.gerritcodereview', 'bazel-cache', 'downloaded-artifacts'))
+CACHE_DIR = os.environ.get(
+ 'GERRIT_CACHE_HOME',
+ os.path.expanduser(os.path.join(
+ '~', '.gerritcodereview', 'bazel-cache', 'downloaded-artifacts'
+ ))
+)
def bower_cmd(bower, *args):