mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-09 20:57:51 +00:00
Two small fixes to shell integration points.
1. Fixing bug where environment variable was being ignored. 2. Adding "UNITY_DIR" to allow a path to unity specified by the environment.
This commit is contained in:
@@ -28,7 +28,12 @@ class CMockGenerator
|
||||
here = File.dirname __FILE__
|
||||
unity_path_in_ceedling = "#{here}/../../unity" # path to Unity from within Ceedling
|
||||
unity_path_in_cmock = "#{here}/../vendor/unity" # path to Unity from within CMock
|
||||
if File.exist? unity_path_in_ceedling
|
||||
# path to Unity as specified by env var
|
||||
unity_path_in_env = ENV.has_key?("UNITY_DIR") ? File.expand_path(ENV.fetch("UNITY_DIR")) : nil
|
||||
|
||||
if unity_path_in_env and File.exist? unity_path_in_env
|
||||
require "#{unity_path_in_env}/auto/type_sanitizer"
|
||||
elsif File.exist? unity_path_in_ceedling
|
||||
require "#{unity_path_in_ceedling}/auto/type_sanitizer"
|
||||
elsif File.exist? unity_path_in_cmock
|
||||
require "#{unity_path_in_cmock}/auto/type_sanitizer"
|
||||
|
||||
Reference in New Issue
Block a user