Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 39 lines (30 sloc) 1006 Bytes
#! /usr/bin/env perl
use warnings;
use strict;
# a small Perl script to fetch the latest snapshot of a git repo from gitweb
# using minimal requirements (perl, tar, gzip, and (curl or wget))
# URL of the download link on github
my $URL = '';
my $tgz = http_fetch($URL);
rename(glob('majnemer-davesdots-*'), 'davesdots');
sub http_fetch {
my $url = shift;
# See if we should use wget or curl
if(grep {-x "$_/curl"} split /:/, $ENV{'PATH'}) {
return qx{curl -L -s '$url'};
} elsif(grep {-x "$_/wget"} split /:/, $ENV{'PATH'}) {
# do not check the cert due to a bug in wget:
return qx{wget --no-check-certificate -O - '$url'};
} else {
die "Could not find curl or wget, aborting!";
sub extract_tgz {
my $data = shift;
open(my $pipe, '|-', 'tar', '-xzf', '-') || die " tar failed: $!";
print $pipe $data;
Something went wrong with that request. Please try again.