Explorar o código

update scripts

julien colomb %!s(int64=2) %!d(string=hai) anos
pai
achega
d8f802be38
Modificáronse 2 ficheiros con 8 adicións e 62 borrados
  1. 4 57
      .scripts/template_init.command
  2. 4 5
      sync-gin-unix

+ 4 - 57
.scripts/template_init.command

@@ -22,66 +22,15 @@ repo="$(echo $repo2 | cut -d' ' -f1)"
 reposhort="$(echo "${repo/.main}")"
 
 
-# readme text
-readmetext="$Gitadress/$Orga/$repo is the parent directory"
-gitign=".DS_Store"
 
-echo "readme will be $readmetext"
+# add some submodules to labreport repository.
 
-echo "erase master branch and go to main if there is a main branch"
-gin git checkout main
-gin git branch -D master
-
-# initialise submodules
 gin git submodule update --init --recursive
 
-# if the template was not initialise before, let's do it
-# new tonic version do that, so this should be obsolete.
-if test -f "03_data/001_raw_data/README_dataraw.md" ;
-then
-    echo "submodules in place, happy working!"
-else
-    echo "setting up the template for the first time !"
-    
-    # add readme files, and folders
-    echo "$readmetext" >> 03_data/001_raw_data/README_dataraw.md
-    echo "$readmetext" >> 04_data_analysis/010_code/README_analysiscode.md
-    echo "$readmetext" >> 05_figures/990_shared_figures/README_figures.md
-    echo "$readmetext" >> 03_data/001_derived_data/README_dataderived.md
-    echo "$readmetext" >> 06_dissemination/README_DISSEMINATION.md
-    
-    echo "$gitign" >> 03_data/001_raw_data/.gitignore
-    echo "$gitign" >> 04_data_analysis/010_code/.gitignore
-    echo "$gitign" >> 05_figures/990_shared_figures/.gitignore
-    echo "$gitign" >> 03_data/001_derived_data/.gitignore
-    echo "$gitign" >> 06_dissemination/.gitignore
-    
-    mkdir 06_dissemination/01_reports_conferences
-    mkdir 06_dissemination/02_manuscripts
-    mkdir 06_dissemination/03_other
-    touch 06_dissemination/01_reports_conferences/.gitkeep
-    touch 06_dissemination/02_manuscripts/.gitkeep
-    touch 06_dissemination/03_other/.gitkeep
-    
-    # add labcommons submodule
-    gin git submodule add "../labcommons" 07_misc/labcommons
-    
-    # push submodule content
-    gin git submodule foreach gin init
-    gin git submodule foreach gin commit . -m initial commit from template
-    gin git submodule foreach gin upload
-    
-
-
-    # arrange parent repository (no rewriting history for security issue)
-    gin git commit . -m "initialisation"
-    gin upload .
-fi
-
-if test -f "00repo_needs_initialisation00.txt" ;
-
+if test -f ".notinlabreport.txt" ;
+  then
     # delete file telling the initialisation need to be done
-    rm "00repo_needs_initialisation00.txt"
+    rm ".notinlabreport.txt"
     
     # add submodule to PI repo
     # get labreports repo and write new folder for the project
@@ -109,6 +58,4 @@ if test -f "00repo_needs_initialisation00.txt" ;
     gin upload
     cd ../
     rm -rf labreports
-    
-
 fi

+ 4 - 5
sync-gin-unix

@@ -31,14 +31,13 @@ else
     echo "gin logged"
 fi
 
-## code 1
-if test -f "00repo_needs_initialisation00.txt" ;
+## code 1, add to labreports
+if test -f ".notinlabreport.txt" ;
   then
-  echo "running project repository initiation (first run)"
+  echo "Adding project to labreports repository."
   sh .scripts/template_init.command
 fi
-
-## code 2
+## code 2, initialising
 
 if grep -q 06_dissemination ".gitmodules"; 
   then