From af47873f280e9832ef19f04d463eb3889036c903 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 19 Feb 2025 11:56:52 -0800 Subject: [PATCH] FIX: hardcoded require for evals (#1137) The require for `discourse/config/environment` should point to the local user's core Discourse environment instead of the hardcoded path for Sam's env. --- 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 15144e90..11120dc5 100644 --- a/evals/lib/boot.rb +++ b/evals/lib/boot.rb @@ -24,12 +24,12 @@ if !Dir.exist?(EVAL_PATH) 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 "/home/sam/Source/discourse/config/environment" +require "#{discourse_path}/config/environment" ENV["DISCOURSE_AI_NO_DEBUG"] = "1" module DiscourseAi::Evals