Autosave: 2022-12-27 18:30:05
This commit is contained in:
		
							parent
							
								
									3f1a747f2f
								
							
						
					
					
						commit
						5f40759a5b
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								_scripts/clean_image_directory.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								_scripts/clean_image_directory.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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
 | 
				
			||||||
 | 
					        echo "Deleted unused image: ${filename##*/}"
 | 
				
			||||||
 | 
					        rm $filename
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue