Mercurial > octave
changeset 30930:f67d2ce5d6d4 stable
pkg.m: Create directory before saving file (bug #62303).
* scripts/pkg/pkg.m: Create directory before saving file when rebuilding package
index.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 12 Apr 2022 17:07:01 +0200 |
parents | fc3b7160ba77 |
children | 1e7a33a0e586 3c3abe6dbe58 |
files | scripts/pkg/pkg.m |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/pkg/pkg.m Mon Apr 11 18:34:05 2022 +0200 +++ b/scripts/pkg/pkg.m Tue Apr 12 17:07:01 2022 +0200 @@ -696,6 +696,10 @@ global_packages = standardize_paths (global_packages); endif global_packages = make_rel_paths (global_packages); + global_list_dir = fileparts (global_list); + if (! isempty (global_list_dir) && ! exist (global_list_dir, "dir")) + mkdir (global_list_dir); + endif save (global_list, "global_packages"); if (nargout) local_packages = global_packages; @@ -707,6 +711,10 @@ if (ispc) local_packages = standardize_paths (local_packages); endif + local_list_dir = fileparts (local_list); + if (! isempty (local_list_dir) && ! exist (local_list_dir, "dir")) + mkdir (local_list_dir); + endif save (local_list, "local_packages"); if (! nargout) clear ("local_packages");