]> gitweb.michael.orlitzky.com - octave.d.git/commitdiff
.octaverc: don't hard-code the repository path
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Mar 2026 12:54:39 +0000 (08:54 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Mar 2026 12:54:39 +0000 (08:54 -0400)
We can find the path to the repository using the path to .octaverc and
canonicalize_file_name().

.octaverc

index 1dbc33c85501102fec14ea317b9768249796fe15..2b5b975f4643b6d9855066fc36dc321d5aa92527 100644 (file)
--- a/.octaverc
+++ b/.octaverc
@@ -5,6 +5,9 @@ history_timestamp_format_string("%%-- %D %I:%M %p --%%");
 page_screen_output(false);
 print_empty_dimensions(false);
 
-addpath(genpath('~/src/octave'));
-addpath(genpath('~/src/octave/misc'));
-addpath(genpath('~/src/octave/optimization'));
+## Add the repository to Octave's load path.
+repository = fileparts(canonicalize_file_name(mfilename('fullpath')));
+addpath(repository);
+addpath(fullfile(repository, "iterative"));
+addpath(fullfile(repository, "misc"));
+addpath(fullfile(repository, "optimization"));