Skip to content

Commit feab4c7

Browse files
author
Christophe Triquet
committed
Remove suffix from repo folder
1 parent 253c012 commit feab4c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nbgitpuller/handlers.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ async def get(self):
7272
# must be expanded.
7373
repo_parent_dir = os.path.join(os.path.expanduser(self.settings['server_root_dir']),
7474
os.getenv('NBGITPULLER_PARENTPATH', ''))
75-
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo.split('/')[-1]))
75+
repo_basename = os.path.splitext(os.path.basename(repo))[0]
76+
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo_basename))
7677

7778
# We gonna send out event streams!
7879
self.set_header('content-type', 'text/event-stream')
@@ -148,8 +149,9 @@ async def get(self):
148149
self.get_argument('subPath', '.')
149150
app = self.get_argument('app', app_env)
150151
parent_reldir = os.getenv('NBGITPULLER_PARENTPATH', '')
152+
repo_basename = os.path.splitext(os.path.basename(repo))[0]
151153
targetpath = self.get_argument('targetpath', None) or \
152-
self.get_argument('targetPath', repo.split('/')[-1])
154+
self.get_argument('targetPath', repo_basename)
153155

154156
if urlPath:
155157
path = urlPath

0 commit comments

Comments
 (0)