#!/usr/bin/python # Python version of the following shell script: # find . -maxdepth 1 \ # -type d \ # -not -exec test -e "{}/.git" ';' \ # -not -path "*/\.*" \ # -print \ # | sed "s/\.\///g" \ # | sort import os forks = [] for item in os.listdir("."): # skip hidden directories, files, and submodules if ( not item.startswith(".") and os.path.isdir(item) and not os.path.isfile(f"{item}/.git") ): forks.append(item) # sort alphabetically forks.sort() for fork in forks: print(fork)