Skip to content

Commit

Permalink
wrong order of src dst when using copyfile, fixes #53
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeets committed Jul 30, 2018
1 parent 8ef2363 commit e5f0125
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mpm.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function listPackages(opts)
isOk = false; return;
end
mkdir(pkg.installdir);
isOk = copyfile(pkg.installdir, pkg.url);
isOk = copyfile(pkg.url, pkg.installdir);
else % no copy; just track the provided path
% make sure we have absolute path
if ~isempty(strfind(pkg.url, pwd))
Expand Down Expand Up @@ -432,7 +432,11 @@ function listPackages(opts)
try
zipfnm = websave(zipfnm, pkg.url);
catch ME
% handle 404 from File Exchange for getting updated download url
ps = strsplit(ME.message, 'for URL, ');
if numel(ps) < 2
isOk = false; return;
end
ps = strsplit(ps{2}, 'github_repo.zip');
pkg.url = ps{1}(2:end);
zipfnm = websave(zipfnm, pkg.url);
Expand Down

0 comments on commit e5f0125

Please sign in to comment.