[why] "/c/lkp-tests" is twice used here, so set it as a constant var LKP_PATH.
[how] ...
Signed-off-by: Xu Xijian hdxuxijian@163.com --- src/scheduler/jobfile_operate.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index d3c26c5..68818ed 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -8,8 +8,9 @@ require "yaml" # require from '/c/lkp-tests/lib/' require "shellwords"
-if ENV["LKP_SRC"] != "/c/lkp-tests" - raise "ENV LKP_SRC mismatch: #{ENV["LKP_SRC"]} '/c/lkp-tests'" +LKP_PATH = "/c/lkp-tests" +if ENV["LKP_SRC"] != LKP_PATH + raise "ENV LKP_SRC mismatch: #{ENV["LKP_SRC"]} #{LKP_PATH}" end
module Jobfile::Operate