Skip to content
Snippets Groups Projects
Verified Commit 075734b1 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix: better test for toolbox

The old test was sometimes saying that the toolbox was installed when it
was not. I do not know why. This seems more robust.
parent 3aac93ab
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ function [Results] = rotare(configFile)
addpath(genpath('.'));
rmpath(genpath('./airfoil_data/'));
addpath('./airfoil_data/');
if license('test', 'Aerospace_Toolbox')
if istoolboxinstalled('Aerospace Toolbox')
rmpath('./libs/octave-atmosisa/');
end
......
function result = istoolboxinstalled(toolbox)
% ISTOOLBOXINSTALLED Check if a toolbox is installed and available
% -----
%
% Syntax:
% result = isToolboxInstalled(toolbox) returns true if the toolbox is intalled.
%
% Inputs:
% toolbox: Name of a toolbox, as displayed in `ver` command
%
% Outputs:
% result : boolean that indicates if toolbox is installed
%
% See also: ver.
%
% <a href="https://gitlab.uliege.be/rotare/documentation">Complete documentation (online)</a>
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022-2024 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
% Repo: https://gitlab.uliege.be/rotare/rotare
% Docs: https://gitlab.uliege.be/rotare/documentation
% Issues: https://gitlab.uliege.be/rotare/rotare/-/issues
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
v = ver;
result = any(strcmp(toolbox, {v.Name}));
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment