Skip to content

Commit

Permalink
cli: Fix file loading bug
Browse files Browse the repository at this point in the history
By opening files in the current working directory.
  • Loading branch information
jhf committed May 13, 2024
1 parent 621f8b5 commit 7185563
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/src/statbus.cr
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ class StatBus

sql_cli_provided_fields = ["valid_from", "valid_to", "tag_path"]
sql_fields_list = sql_cli_provided_fields + sql_field_required_list + sql_field_optional_list
csv_stream = CSV.new(File.open(import_file_name), headers: true, separator: ',', quote_char: '"')
file_stream =
Dir.cd(@working_directory) do
File.open(import_file_name)
end
csv_stream = CSV.new(file_stream, headers: true, separator: ',', quote_char: '"')
csv_fields_list = csv_stream.headers
# For every equal header, insert a mapping.
sql_field_required = sql_field_required_list.to_set
Expand Down

0 comments on commit 7185563

Please sign in to comment.