Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2016-12-30 21:41:50 +0300
committerAleksander Machniak <alec@alec.pl>2016-12-30 21:41:50 +0300
commitcb09ff0ffcb2a06c9dd493b5441c03483da8c84a (patch)
treed4a450c5439fecd0c74224f12d73525230e3ccac /bin
parent40cd8d3bdd8d360f9eae8d98171011942141dae1 (diff)
Make it working with wget when curl is not installed, mark --force argument as boolean
Diffstat (limited to 'bin')
-rwxr-xr-xbin/install-jsdeps.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/install-jsdeps.sh b/bin/install-jsdeps.sh
index ebc539d88..c92c94a2f 100755
--- a/bin/install-jsdeps.sh
+++ b/bin/install-jsdeps.sh
@@ -102,14 +102,19 @@ EOL;
*/
function fetch_from_source($package, $useCache = true, &$filetype = null)
{
- global $CURL, $FILEINFO, $CACHEDIR;
+ global $CURL, $WGET, $FILEINFO, $CACHEDIR;
$filetype = pathinfo($package['url'], PATHINFO_EXTENSION) ?: 'tmp';
$cache_file = $CACHEDIR . '/' . $package['lib'] . '-' . $package['version'] . '.' . $filetype;
if (!is_readable($cache_file) || !$useCache) {
echo "Fetching $package[url]\n";
- exec(sprintf('%s -s %s -o %s', $CURL, escapeshellarg($package['url']), $cache_file), $out, $retval);
+
+ if ($CURL)
+ exec(sprintf('%s -s %s -o %s', $CURL, escapeshellarg($package['url']), $cache_file), $out, $retval);
+ else
+ exec(sprintf('%s -q %s -O %s', $WGET, escapeshellarg($package['url']), $cache_file), $out, $retval);
+
if ($retval !== 0) {
die("ERROR: Failed to download source file from " . $package['url'] . "\n");
}
@@ -252,7 +257,7 @@ function extrac_zipfile($package, $srcfile)
//////////////// Execution
-$args = rcube_utils::get_opt(array('f' => 'force')) + array('force' => false);
+$args = rcube_utils::get_opt(array('f' => 'force:bool')) + array('force' => false);
$WHAT = $args[0];
foreach ($SOURCES['dependencies'] as $package) {