Skip to content

Commit

Permalink
Merge pull request #583 from cchampet/fix_samRmRemoveDirectoryFileLink
Browse files Browse the repository at this point in the history
sam rm: fixed how to remove directory / file / link
  • Loading branch information
cchampet authored Aug 30, 2016
2 parents 3c45d6a + 993855f commit a66600f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions applications/sam/sam_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,12 @@ def run(self, parser):
for inputPath in args.inputs:
items = []

# input is a directory
if os.path.isdir(inputPath):
items.append(sequenceParser.Item(sequenceParser.eTypeFolder, inputPath))
# else browse directory with a filter, to find the corresponding Item
# if the input is a file/link
if os.path.isfile(inputPath):
items.append(sequenceParser.Item(sequenceParser.eTypeFile, inputPath))
elif os.path.islink(inputPath):
items.append(sequenceParser.Item(sequenceParser.eTypeLink, inputPath))
# else browse in the extracted directory with the basename as filter
else:
# get path to browse
pathToBrowse = os.path.dirname(inputPath)
Expand Down

0 comments on commit a66600f

Please sign in to comment.