@staticmethod
    def initialize(root_dir):
        dirs = next(os.walk(root_dir))[1]
        repos = []
        skipped = []
        for directory in dirs:
            os.chdir(os.path.join(root_dir, directory))
            if Git.is_git_repo():
                log.echo(' [blue]::[reset] Found directory'
                         ' `[white]{}[reset]`'.format(directory))
                url = Git.get_remote_url()
                name = url.replace(':', '/')
                name = re.sub('.git$', '', name)
                name = '/'.join(name.split('/')[-2:])
                if name.split('/')[1] == directory:
                    repos.append(name)
                else:
                    repos.append({'dir': directory, 'name': name})
            else:
                skipped.append(directory)

        log.echo(' [blue]::[yellow] Skipped[reset]'
                 ' non-git repositories: {}'.format(', '.join(skipped)))

        return {
            'name': os.path.basename(root_dir),
            'dir': root_dir,
            'repos': repos
        }
Initialize a new workspace .mx.yml file
dataset/ETHPy150Open rafi/mx/src/mx/workspace.py/Workspace.initialize