From eb90cc3710c6778d32110d02d58feba20e9b52ed Mon Sep 17 00:00:00 2001 From: Michaja Pehl Date: Fri, 5 Jun 2026 09:00:51 +0200 Subject: [PATCH] Dynamically calculate calibration_resuts path Change calibration_results/Rprofile_calibration_results to use the current directory the file is located in for the remind_repos option to allow for moving project directories after the calibration_results directory has been set up. See https://mattermost.pik-potsdam.de/rd3/pl/iiionod59bdquxpj6io7z87bur --- scripts/utils/set-local-calibration.sh | 7 ++----- .../set-local-calibration/.Rprofile_calibration_results | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 scripts/utils/set-local-calibration/.Rprofile_calibration_results diff --git a/scripts/utils/set-local-calibration.sh b/scripts/utils/set-local-calibration.sh index a5c256c760..cfb8333f5e 100755 --- a/scripts/utils/set-local-calibration.sh +++ b/scripts/utils/set-local-calibration.sh @@ -24,10 +24,7 @@ cp ../scripts/utils/set-local-calibration/pre-commit .git/hooks cp ../scripts/utils/set-local-calibration/post-commit .git/hooks chmod u+x .git/hooks/pre-commit .git/hooks/post-commit -# create additional .Rprofile (sourced through default .Rprofile) -echo -e "options(remind_repos = c(\n" \ - " getOption(\"remind_repos\"),\n" \ - " stats::setNames(list(x = NULL), \"$PWD\")))" \ - > .Rprofile_calibration_results +# add additional .Rprofile (sourced through default .Rprofile) +cp ../scripts/utils/set-local-calibration/.Rprofile_calibration_results ./ cd "$OLDPWD" diff --git a/scripts/utils/set-local-calibration/.Rprofile_calibration_results b/scripts/utils/set-local-calibration/.Rprofile_calibration_results new file mode 100644 index 0000000000..0443d720e8 --- /dev/null +++ b/scripts/utils/set-local-calibration/.Rprofile_calibration_results @@ -0,0 +1,4 @@ +options(remind_repos = c( + getOption("remind_repos"), + stats::setNames(list(x = NULL), + dirname(normalizePath(parent.frame(2)[['ofile']])))))