Skip to content

Commit

Permalink
Remove suffix from repo folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Triquet committed Jun 17, 2024
1 parent c322bea commit 1b122fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nbgitpuller/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ async def get(self):
# must be expanded.
repo_parent_dir = os.path.join(os.path.expanduser(self.settings['server_root_dir']),
os.getenv('NBGITPULLER_PARENTPATH', ''))
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo.split('/')[-1]))
repo_basename = os.path.splitext(os.path.basename(repo))[0]
repo_dir = os.path.join(repo_parent_dir, self.get_argument('targetpath', repo_basename))

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

if urlPath:
path = urlPath
Expand Down

0 comments on commit 1b122fb

Please sign in to comment.