def visitor_reposize(repos, options): # this tool will ignore submodules, since dirsize will consider subfolders repos_filtered = path_utils.filter_path_list_no_same_branch(repos) total = 0 for rp in repos_filtered: rs = dirsize.get_dir_size(rp, False) total += rs print("%s: %s" % (rp, sizeof_fmt(int(rs), ''))) print("Total size of all repos: %s" % sizeof_fmt(total, '')) return True
def make_path_list(paths_to_consider): """ make_path_list assembles a list of valid paths, based on function parameter and envvar returns None if no paths are put together """ paths = [] if paths_to_consider is not None: for pc in paths_to_consider: paths.append(pc) path_env = get_path_from_env() if path_env is not None: paths.append(path_env) paths = path_utils.filter_path_list_no_same_branch(paths) # sanitises paths list if len(paths) == 0: return None return paths