mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-04-13 09:30:06 +00:00
manual_fetch.pl: added curl support, and made it complain if curl nor wget are present
This commit is contained in:
parent
807841a2d0
commit
878552c544
1 changed files with 9 additions and 1 deletions
10
manual_fetch.pl
Normal file → Executable file
10
manual_fetch.pl
Normal file → Executable file
|
@ -21,7 +21,15 @@ extract_tgz($tgz);
|
||||||
|
|
||||||
sub http_fetch {
|
sub http_fetch {
|
||||||
my $url = shift;
|
my $url = shift;
|
||||||
return qx{wget -O - '$url'};
|
|
||||||
|
# See if we should use wget or curl
|
||||||
|
if(grep {-x "$_/curl"} split /:/, $ENV{'PATH'}) {
|
||||||
|
return qx{curl -s '$url'};
|
||||||
|
} elsif(grep {-x "$_/wget"} split /:/, $ENV{'PATH'}) {
|
||||||
|
return qx{wget -O - '$url'};
|
||||||
|
} else {
|
||||||
|
die "Could not find curl or wget, aborting!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub extract_tgz {
|
sub extract_tgz {
|
||||||
|
|
Loading…
Add table
Reference in a new issue