Create img purge script and apply
This commit is contained in:
		
							parent
							
								
									5f40759a5b
								
							
						
					
					
						commit
						9c5fe6a3e0
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		
							
								
								
									
										3
									
								
								_scripts/clean_image_directory.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										3
									
								
								_scripts/clean_image_directory.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
# If there are images in _img/ that are not being used in the workspace, delete them   
 | 
			
		||||
find /home/thomas/repos/computer_science/img -type f | while read filename; do
 | 
			
		||||
    rg "${filename##*/}" ../ --type markdown >/dev/null 2>&1
 | 
			
		||||
    if [ "$?" -eq 1 ]; then
 | 
			
		||||
| 
						 | 
				
			
			@ -7,5 +8,3 @@ find /home/thomas/repos/computer_science/img -type f | while read filename; do
 | 
			
		|||
        rm $filename
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue