Skip to content

Commit 8a1611b

Browse files
committed
fix micro issues on cloning from remote git
1 parent c5cf43a commit 8a1611b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ipython2cwl/repo2cwl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,17 @@ def repo2cwl(argv: Optional[List[str]] = None):
100100
supported_schemes = {'file', 'http', 'https', 'ssh'}
101101
if uri.scheme not in supported_schemes:
102102
raise ValueError(f'Supported schema uris: {supported_schemes}')
103-
local_git_directory = os.path.join(tempfile.mkdtemp(prefix='repo2cwl'), 'repo')
103+
local_git_directory = os.path.join(tempfile.mkdtemp(prefix='repo2cwl_'), 'repo')
104104
if uri.scheme == 'file':
105105
if not os.path.isdir(uri.path):
106106
raise ValueError(f'Directory does not exists')
107107
logger.info(f'copy repo to temp directory: {local_git_directory}')
108108
shutil.copytree(uri.path, local_git_directory)
109+
local_git = git.Repo(local_git_directory)
109110
else:
110111
logger.info(f'cloning repo to temp directory: {local_git_directory}')
111-
git.Git(local_git_directory).clone(uri.geturl())
112-
local_git = git.Repo(local_git_directory)
112+
local_git = git.Repo.clone_from(uri.geturl(), local_git_directory)
113+
113114
image_id, cwl_tools = _repo2cwl(local_git)
114115
logger.info(f'Generated image id: {image_id}')
115116
for tool in cwl_tools:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def get_version(rel_path):
4949
],
5050
entry_points={
5151
'console_scripts': [
52-
'jupyter-jn2cwl=ipython2cwl.ipython2cwl:main',
53-
'jupyter-jnrepo2cwl=ipython2cwl.repo2cwl:repo2cwl',
52+
# 'jupyter-jn2cwl=ipython2cwl.ipython2cwl:main',
53+
'jupyter-repo2cwl=ipython2cwl.repo2cwl:repo2cwl',
5454
],
5555
},
5656
install_requires=[

0 commit comments

Comments
 (0)