This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
import time | |
def retry(num_attempts=3, exception_class=(Exception, ), sleeptime=1): | |
def decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
for i in range(1, num_attempts+1): | |
try: | |
return func(*args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last_two_commits=$(git log -n 2 --first-parent master --pretty=format:"%H") | |
files=$(git diff --name-only ${last_two_commits}) | |
folders=() | |
for file in ${files[@]}; do | |
# echo $file | |
folder=$(echo $file | cut -d'/' -f1) | |
folders+=($folder) |