Skip to content

Commit

Permalink
Merge pull request #1816 from NREL/fix/issue1815
Browse files Browse the repository at this point in the history
Change current directory for CLI
  • Loading branch information
mdahlhausen authored Sep 26, 2024
2 parents e72970f + 21a632a commit 9fca7da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/openstudio-standards/weather/information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def self.model_get_full_weather_file_path(model)
full_epw_path = OpenStudio::OptionalPath.new(epw_path.get)
else
# If this is an always-run Measure, need to check a different path
alt_weath_path = File.expand_path(File.join(Dir.pwd, '../../resources'))
alt_weath_path = File.expand_path(File.join(__dir__, '../../resources'))
alt_epw_path = File.expand_path(File.join(alt_weath_path, epw_path.get.to_s))
if File.exist?(alt_epw_path)
full_epw_path = OpenStudio::OptionalPath.new(OpenStudio::Path.new(alt_epw_path))
Expand Down Expand Up @@ -202,7 +202,7 @@ def self.get_standards_weather_file_path(weather_file_name)
stat_string = load_resource_relative("../../../data/weather/#{weather_file_name.gsub('.epw', '.stat')}")

# extract to local weather dir
weather_dir = File.expand_path(File.join(Dir.pwd, 'extracted_files/weather/'))
weather_dir = File.expand_path(File.join(__dir__, 'extracted_files/weather/'))
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.Weather.information', "Extracting weather files from OpenStudio CLI to #{weather_dir}")
FileUtils.mkdir_p(weather_dir)

Expand Down

0 comments on commit 9fca7da

Please sign in to comment.