Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
bf52f5d5
Commit
bf52f5d5
authored
Aug 27, 2015
by
Jorge Bucaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix basename polyfill
parent
ed688aac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
lib/basename.fish
lib/basename.fish
+15
-19
No files found.
lib/basename.fish
View file @
bf52f5d5
...
@@ -3,27 +3,23 @@
...
@@ -3,27 +3,23 @@
# basename [-s suffix] <string> [string...]
# basename [-s suffix] <string> [string...]
#
#
# OVERVIEW
# OVERVIEW
#
osx style
variable arguments basename
# variable arguments basename
function basename -d "get the filename or directory part of a path"
function basename -d "get the filename or directory part of a path"
if test (uname) = "Darwin"
if set -q argv[1]
command basename $argv
set -l ext ""
else
switch $argv[1]
if set -q argv[1]
case -s
set -l ext ""
if test (count $argv) -gt 2
switch $argv[1]
set ext $argv[2]
case -s
set argv $argv[3..-1]
if test (count $argv) -gt 2
else
set ext $argv[2]
echo "basename: Invalid number of arguments"
set argv $argv[3..-1]
return 1
else
end
echo "basename: Invalid number of arguments"
end
return 1
for path in $argv
end
command basename "$path" "$ext"
end
for path in $argv
command basename "$path" "$ext"
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment