mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Make: Retool how we cache go dirs
Now we can use /dev/null as an argument when running tools manually
This commit is contained in:
		@@ -54,19 +54,19 @@ function kfind() {
 | 
				
			|||||||
        | sed 's|^./staging/src|vendor|'
 | 
					        | sed 's|^./staging/src|vendor|'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NEED_FIND=true
 | 
					 | 
				
			||||||
# It's *significantly* faster to check whether any directories are newer than
 | 
					# It's *significantly* faster to check whether any directories are newer than
 | 
				
			||||||
# the cache than to blindly rebuild it.
 | 
					# the cache than to blindly rebuild it.
 | 
				
			||||||
if [[ -f "${CACHE}" ]]; then
 | 
					if [[ -f "${CACHE}" && -n "${CACHE}" ]]; then
 | 
				
			||||||
    N=$(kfind -type d -newer "${CACHE}" -print -quit | wc -l)
 | 
					    N=$(kfind -type d -newer "${CACHE}" -print -quit | wc -l)
 | 
				
			||||||
    [[ "${N}" == 0 ]] && NEED_FIND=false
 | 
					    if [[ "${N}" == 0 ]]; then
 | 
				
			||||||
 | 
					        cat "${CACHE}"
 | 
				
			||||||
 | 
					        exit
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir -p "$(dirname "${CACHE}")"
 | 
					mkdir -p "$(dirname "${CACHE}")"
 | 
				
			||||||
if ${NEED_FIND}; then
 | 
					kfind -type f -name \*.go  \
 | 
				
			||||||
    kfind -type f -name \*.go  \
 | 
					 | 
				
			||||||
    | sed 's|/[^/]*$||'    \
 | 
					    | sed 's|/[^/]*$||'    \
 | 
				
			||||||
    | sed 's|^./||'        \
 | 
					    | sed 's|^./||'        \
 | 
				
			||||||
    | LC_ALL=C sort -u     \
 | 
					    | LC_ALL=C sort -u     \
 | 
				
			||||||
        > "${CACHE}"
 | 
					    | tee "${CACHE}"
 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
cat "${CACHE}"
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user