From b68ff67d926eda3ff051eb3fe1e5421630608d87 Mon Sep 17 00:00:00 2001
From: Jan Lemmer <jan.lemmer@fst.tu-darmstadt.de>
Date: Thu, 24 Feb 2022 09:27:03 +0100
Subject: [PATCH] Add do not move warning and file

---
 +PlotID/Publish.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/+PlotID/Publish.m b/+PlotID/Publish.m
index f571cc4..45e8a31 100644
--- a/+PlotID/Publish.m
+++ b/+PlotID/Publish.m
@@ -168,6 +168,8 @@ end
 switch options.Method
     case 'centralized' 
         DataFolderName = 'data';
+        warning(['Linked HDF5 can only be moved with their ',...
+            'respective master files in the ', DataFolderName, ' folder.']);
         % check if data folder exists
         if ~isfolder(fullfile(storPath,DataFolderName))
             mkdir(fullfile(storPath,DataFolderName));
@@ -210,8 +212,13 @@ switch options.Method
                    [status] = PlotID.createLinkedHDF5(pathToData,linkedHDFPath);
                 end  %if
             end %if
+            % add do not move message
+            doNotMove = ['do not move this folder without the ',...
+                DataFolderName, ' folder'];
+            fid = fopen(fullfile(storPath,folderName,[doNotMove,'.txt']),'w');
+            fprintf(fid,doNotMove); fclose(fid);
         end %for
-        clear DataFolderName 
+        clear DataFolderName doNotmove
     case 'individual'
         % Create a copy of the research data    
         [~, status, msg] = PlotID.createFileCopy(dataObj.DataPaths,folderName,storPath,ID, 'data');
-- 
GitLab