Skip to content

Commit

Permalink
Merge pull request #74 from nesi/dini-dev
Browse files Browse the repository at this point in the history
add cleanup rules to run_snakefile.sh
  • Loading branch information
DininduSenanayake authored Oct 14, 2024
2 parents 19b1d62 + d3ce44f commit 3e756da
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion 08-snakemake/run_snakefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,19 @@ else
exit 1
fi

echo "All processing completed."
echo "All processing completed."

# Check if FAILED_CONFIG is empty and FAILED_DB has at most one file
if [ -z "$(ls -A FAILED_CONFIG 2>/dev/null)" ] && [ $(ls -1 FAILED_DB 2>/dev/null | wc -l) -le 1 ]; then
echo "FAILED_CONFIG is empty and FAILED_DB has at most one file. Cleaning up files..."

# Delete files with .processed and .apsimx extensions
find . -maxdepth 1 -type f \( -name "*.processed" -o -name "*.apsimx" -o -name "*.txt" -o -name "*.met" \) -delete

# Delete txt_files_processed and db_files_sorted files
rm -f txt_files_processed db_files_sorted

echo "Cleanup completed."
else
echo "FAILED_CONFIG is not empty or FAILED_DB has more than one file. Skipping cleanup."
fi

0 comments on commit 3e756da

Please sign in to comment.