if exist ("isfolder") == 0
 if (isdir (fullfile (fileparts (mfilename ("fullpath")), "sensors")))
   rmpath (fullfile (fileparts (mfilename ("fullpath")), "sensors"));
 endif
else
 if (isfolder (fullfile (fileparts (mfilename ("fullpath")), "sensors")))
   rmpath (fullfile (fileparts (mfilename ("fullpath")), "sensors"));
 endif
endif

# on package load, attempt to unload docs
try
  pkg_dir = fileparts (fullfile (mfilename ("fullpath")));
  doc_file = fullfile (pkg_dir, "doc", "arduino.qch");
  if exist(doc_file, "file")
    if exist("__event_manager_unregister_documentation__")
      __event_manager_unregister_documentation__ (doc_file);
    elseif exist("__event_manager_unregister_doc__")
      __event_manager_unregister_doc__ (doc_file);
    endif
  endif
catch
  # do nothing
end_try_catch
