Skip to content

Commit

Permalink
add try catch for .env file check on telemetry.m
Browse files Browse the repository at this point in the history
  • Loading branch information
bendhouseart committed Aug 15, 2024
1 parent b360317 commit 878d4ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions matlab/telemetry.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ function telemetry(telemetry_data, input_path, output_path)
end

home_dir = environment("HOME");
loadenv(fullfile(home_dir, '.pet2bidsconfig'), FileType='env');
% convert string to boolean/logical
try
loadenv(fullfile(home_dir, '.pet2bidsconfig'), FileType='env');
% convert string to boolean/logical
catch ME
disable_telemetry = false;
end

disable_telemetry = strcmpi(getenv("TELEMETRY_ENABLED"), 'false');

if disable_telemetry | disable_telemetry_env
Expand Down

0 comments on commit 878d4ac

Please sign in to comment.