From b1f27f748560d5cedcf3801cc94cb452f459ec54 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 19 Feb 2025 09:48:35 -0800 Subject: [PATCH 1/2] FIX: hardcoded require for evals --- evals/lib/boot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evals/lib/boot.rb b/evals/lib/boot.rb index 15144e90b..d6b6ec0f8 100644 --- a/evals/lib/boot.rb +++ b/evals/lib/boot.rb @@ -29,7 +29,7 @@ Dir.chdir(discourse_path) # rubocop:enable Discourse/NoChdir -require "/home/sam/Source/discourse/config/environment" +require File.expand_path("../../../../discourse/config/environment", __dir__) ENV["DISCOURSE_AI_NO_DEBUG"] = "1" module DiscourseAi::Evals From 9cb4124a3b93ff191f4c9b37633ecccb53a80806 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 19 Feb 2025 11:32:30 -0800 Subject: [PATCH 2/2] DEV: Allow for env for users with symlinks --- evals/lib/boot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evals/lib/boot.rb b/evals/lib/boot.rb index d6b6ec0f8..11120dc58 100644 --- a/evals/lib/boot.rb +++ b/evals/lib/boot.rb @@ -24,12 +24,12 @@ end end -discourse_path = File.expand_path(File.join(__dir__, "../../../..")) +discourse_path = ENV["DISCOURSE_PATH"] || File.expand_path(File.join(__dir__, "../../../..")) # rubocop:disable Discourse/NoChdir Dir.chdir(discourse_path) # rubocop:enable Discourse/NoChdir -require File.expand_path("../../../../discourse/config/environment", __dir__) +require "#{discourse_path}/config/environment" ENV["DISCOURSE_AI_NO_DEBUG"] = "1" module DiscourseAi::Evals