Skip to content

Commit c06ea30

Browse files
committed
change - to _ in repositories name for python import to work
1 parent e754e52 commit c06ea30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: ctf_cli/application.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def list_remotes(self):
139139

140140
def add_submodule(self, path):
141141
url = self._cli_conf.get(CTFCliConfig.GLOBAL_SECTION_NAME, CTFCliConfig.CONFIG_REMOTE_URL)
142-
dirname = os.path.splitext(os.path.basename(url))[0]
142+
dirname = os.path.splitext(os.path.basename(url))[0].replace('-', '_')
143143
check_call('git submodule add %s %s' % (url, path + "/" + dirname), shell=True)
144144

145145
def remove_remote(self):

Diff for: ctf_cli/behave.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _write_environment_py(self):
272272
"""
273273
project_env_py = glob.glob(os.path.join(self._working_dir, '*environment.py'))
274274
if project_env_py:
275-
module_name = os.path.basename(project_env_py[0]).replace('.py', '')
275+
module_name = os.path.basename(project_env_py[0]).replace('.py', '').replace('-', '_')
276276
import_statement = 'from {0} import *\n'.format(module_name)
277277
import_statement += 'import {0}'.format(module_name)
278278
else:

0 commit comments

Comments
 (0)