Skip to content
Snippets Groups Projects
Commit 66eacad0 authored by Guido Sterbini's avatar Guido Sterbini
Browse files

cosmetics

parent acf369ca
No related branches found
No related tags found
2 merge requests!2Dev v0.0.1,!1Dev v0.0.1
Pipeline #2790032 passed
'''
This package helps to create download a update a list of git repository.
'''
# conda env export -n base > environment.yml
# conda env create --prefix /home/HPC/sterbini/test1 -f environment.yml
# import git
......@@ -10,12 +13,17 @@ from pathlib import Path
# https://stackoverflow.com/questions/14989858/
def get_hash(repo):
''' Given the repository path it gives the hash of the present git version.'''
#os.chdir(str(Path(repo).expanduser()))
return subprocess.check_output([f'git', '-C', f'{str(Path(repo).expanduser())}',
'rev-parse', 'HEAD'])[0:-1].decode("utf-8")
def create_base(my_base, my_list, verbose=False):
def create_base(my_list, verbose=False):
'''Given a path a list of dictionary containint the *folder_name* and
the *repo* field (address of the repository) it *git clone* the
the repositories (or *git pull* if already cloned).
'''
for ii in my_list:
print(f'**** {ii["repo"]} to {ii["folder_name"]} ****')
if Path(ii["folder_name"]).is_dir():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment