Skip to content

Commit

Permalink
Merge pull request #356 from yuvipanda/fix-trailing
Browse files Browse the repository at this point in the history
Handle extra trailing slash when determining default targetpath
  • Loading branch information
minrk authored Aug 13, 2024
2 parents b397e4f + b8a076b commit 9e317a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nbgitpuller/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ async def get(self):
self.get_argument('subPath', '.')
app = self.get_argument('app', app_env)
parent_reldir = os.getenv('NBGITPULLER_PARENTPATH', '')
# Remove trailing slashes before determining default targetPath
# Otherwise we end up with targetpath being `.`, which always exists (given it is current
# working directory) and we end up with weird failures
targetpath = self.get_argument('targetpath', None) or \
self.get_argument('targetPath', repo.split('/')[-1])
self.get_argument('targetPath', repo.rstrip('/').split('/')[-1])

if urlPath:
path = urlPath
Expand Down

0 comments on commit 9e317a9

Please sign in to comment.