Skip to content

Commit 1b122fb

Browse files
author
Christophe Triquet
committed
Remove suffix from repo folder
1 parent c322bea commit 1b122fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nbgitpuller/handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def get(self):
7878
# must be expanded.
7979
repo_parent_dir = os.path.join(os.path.expanduser(self.settings['server_root_dir']),
8080
os.getenv('NBGITPULLER_PARENTPATH', ''))
81-
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo.split('/')[-1]))
81+
repo_basename = os.path.splitext(os.path.basename(repo))[0]
82+
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo_basename))
8283

8384
# We gonna send out event streams!
8485
self.set_header('content-type', 'text/event-stream')
@@ -154,8 +155,9 @@ async def get(self):
154155
self.get_argument('subPath', '.')
155156
app = self.get_argument('app', app_env)
156157
parent_reldir = os.getenv('NBGITPULLER_PARENTPATH', '')
158+
repo_basename = os.path.splitext(os.path.basename(repo))[0]
157159
targetpath = self.get_argument('targetpath', None) or \
158-
self.get_argument('targetPath', repo.split('/')[-1])
160+
self.get_argument('targetPath', repo_basename)
159161

160162
if urlPath:
161163
path = urlPath

0 commit comments

Comments
 (0)