Skip to content

Commit

Permalink
Merge pull request #10 from mandx/fix/handle-filenames-with-multiple-…
Browse files Browse the repository at this point in the history
…dots

Handle filenames with more than one period
  • Loading branch information
braver committed Aug 6, 2017
2 parents 1b795ff + 4377ff3 commit 5cdfe7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SideBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ class SideBarDuplicateCommand(SideBarCommand):
def run(self, paths):
self.source = self.get_path(paths)
leaf = os.path.split(self.source)[1]

name, ext = os.path.splitext(leaf)
while '.' in name:
name, _ext = os.path.splitext(name)
ext = _ext + ext

initial_text = name + ' (Copy)' + ext
input_panel = self.window.show_input_panel(
'Duplicate As:',
Expand Down

0 comments on commit 5cdfe7d

Please sign in to comment.