Skip to content

Commit

Permalink
Update downloadAllSupport.m
Browse files Browse the repository at this point in the history
also don't unzip etc. when we fail.
  • Loading branch information
MarkRich authored Jun 17, 2016
1 parent 827879e commit 65a6dd0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pmtkTools/supportTools/downloadAllSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ function downloadAllSupport(destnRoot, quiet)
githubUrl = 'https://github.com/probml/pmtksupport/archive/master.zip';
temporaryZipFile = strcat(destnRoot, 'temp.zip');
[f, success] = urlwrite(githubUrl, temporaryZipFile);
if ~quiet & ~success, fprintf(2, 'failed to download\n'); end
unzip(temporaryZipFile, destnRoot);
delete(temporaryZipFile);
movefile(strcat(destnRoot, '/pmtksupport-master/*'), destnRoot);
rmdir(strcat(destnRoot, '/pmtksupport-master'));
if success
unzip(temporaryZipFile, destnRoot);
delete(temporaryZipFile);
movefile(strcat(destnRoot, '/pmtksupport-master/*'), destnRoot);
rmdir(strcat(destnRoot, '/pmtksupport-master'));
elseif ~quiet
fprintf(2, 'failed to download\n');
end

addpath(genpath(destnRoot)); % using genpathPMTK here causes problems for Octave
rootText = ...
Expand Down

0 comments on commit 65a6dd0

Please sign in to comment.