mirror of
				https://github.com/Unstructured-IO/unstructured.git
				synced 2025-10-31 18:14:51 +00:00 
			
		
		
		
	 bd8a74d686
			
		
	
	
		bd8a74d686
		
			
		
	
	
	
	
		
			
			Given the tendency for shell scripts to easily enter into a few levels of indentation and long line lengths, update the default to 2 spaces.
		
			
				
	
	
		
			23 lines
		
	
	
		
			659 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			659 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| function cleanup_dir() {
 | |
|   # NOTE(crag): for developers that want to always clean up .json outputs, etc., set
 | |
|   # export UNSTRUCTURED_CLEANUP_DEV_FIXTURES=1
 | |
|   if [ "$CI" != "true" ] &&
 | |
|     [ -n "$UNSTRUCTURED_CLEANUP_DEV_FIXTURES" ] &&
 | |
|     [ "$UNSTRUCTURED_CLEANUP_DEV_FIXTURES" != "0" ]; then
 | |
|     return 0
 | |
|   fi
 | |
|   local dir_to_cleanup="${1}"
 | |
|   echo "--- Running cleanup of $dir_to_cleanup ---"
 | |
| 
 | |
|   if [ -d "$dir_to_cleanup" ]; then
 | |
|     echo "cleaning up directory: $dir_to_cleanup"
 | |
|     rm -rf "$dir_to_cleanup"
 | |
|   else
 | |
|     echo "$dir_to_cleanup does not exist or is not a directory, skipping deletion"
 | |
|   fi
 | |
| 
 | |
|   echo "--- Cleanup done ---"
 | |
| }
 |