Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:51

0001 #!/bin/bash
0002 
0003 # List all objects in the RECO or FULL directory
0004 OBJECTS=$(mc ls S3/eictest/EPIC/$1)
0005 
0006 # Iterate over the objects: print their names and create folders in the repository containing index.md
0007 while IFS= read -r object; do
0008   name_only=$(echo "$object" | sed -n 's/^\[[^][]*][[:blank:]]*[^[:blank:]]*[[:blank:]]*\(.*\)$/\1/p') # extracts the folder name from mc ls
0009   mkdir -p ./docs/$1/"${name_only}"
0010   touch ./docs/$1/"${name_only}"index.md
0011   echo '```' > ./docs/$1/"${name_only}"index.md
0012   mc tree --files S3/eictest/EPIC/$1/"${name_only}" | sed 's/.*\.root$//g' | uniq -c | sed 's/.*1 //' | sed 's%S3/eictest%root://dtn-eic.jlab.org//work/eic2%g' >> ./docs/$1/"${name_only}"index.md # contructs tree diagram with count of files in each directory
0013   echo '```' >> ./docs/$1/"${name_only}"index.md
0014   echo -e "- text: "$name_only"\n  url: "/epic-prod/$1/$name_only""
0015 done <<< "$OBJECTS"