Skip to content

WIP: Refinement tree #145

WIP: Refinement tree

WIP: Refinement tree #145

# Move molfiles, metadata, and drawings at root to a subfolder named after the molecule.
name: format_dataset
on:
push:
paths:
- 'tests/molfiles/**'
workflow_dispatch:
jobs:
molecule_subdirectories:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: move files
run: |
shopt -s extglob # enables use of patterns when stripping `moldata` to obtain `molname`
shopt -s nullglob # don't execute loop in case there's no matching `moldata`
cd tests/molfiles
for moldata in ./*.mol ./*_metadata.txt ./*_drawing.*; do
molname=${moldata%@(.mol|_metadata.txt|_drawing.*)}
if [ ! -d "$molname" ]; then
echo "Making ${molname} directory."
mkdir "${molname}"
fi
mv "$moldata" "${molname}"
done
- name: push changes
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "Auto-formatted test dataset."
git push
fi