mirror of https://github.com/jorgebucaran/fisher
Improve __fisher_name name resolution algorithm.
Improve __fisher_name name resolution from paths or URLs more accurately. Now correctly process names paths such as fisher-plugin-*, fisher-theme-* and other permutations.pull/125/head
parent
7929b61caa
commit
b9a158d4fc
@ -1,3 +1,6 @@
|
||||
function __fisher_name
|
||||
sed -E 's|.*/(.*)|\1|; s/^(plugin|omf-theme|theme|pkg|omf|fish|fisher)-//'
|
||||
sed -E '
|
||||
s|.*/(.*)|\1|
|
||||
s/(plugin|omf-theme|theme|pkg|omf|fish|fisher|fisherman)-//g
|
||||
'
|
||||
end
|
||||
|
@ -1,31 +1,86 @@
|
||||
test "$TESTNAME - Remove plugin- prefix"
|
||||
test "$TESTNAME - Remove plugin-* prefix"
|
||||
bar = (echo https://github.com/foo/plugin-bar | __fisher_name)
|
||||
end
|
||||
test "$TESTNAME - Remove plugin-theme-* prefix"
|
||||
bar = (echo https://github.com/foo/plugin-theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove omf-theme- prefix"
|
||||
test "$TESTNAME - Remove omf-theme-* prefix"
|
||||
bar = (echo https://github.com/foo/omf-theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove theme- prefix"
|
||||
test "$TESTNAME - Remove theme-omf-* prefix"
|
||||
bar = (echo https://github.com/foo/theme-omf-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove theme-* prefix"
|
||||
bar = (echo https://github.com/foo/theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove pkg- prefix"
|
||||
test "$TESTNAME - Remove pkg-* prefix"
|
||||
bar = (echo https://github.com/foo/pkg-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove omf- prefix"
|
||||
test "$TESTNAME - Remove pkg-pkg-* prefix"
|
||||
bar = (echo https://github.com/foo/pkg-pkg-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove omf-* prefix"
|
||||
bar = (echo https://github.com/foo/omf-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fish- prefix"
|
||||
test "$TESTNAME - Remove fish-* prefix"
|
||||
bar = (echo https://github.com/foo/fish-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisher- prefix"
|
||||
test "$TESTNAME - Remove fish-fish-* prefix"
|
||||
bar = (echo https://github.com/foo/fish-fish-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisher-* prefix"
|
||||
bar = (echo https://github.com/foo/fisher-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisher-fisher-* prefix"
|
||||
bar = (echo https://github.com/foo/fisher-fisher-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisher-theme-* prefix"
|
||||
bar = (echo https://github.com/foo/fisher-theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove theme-fisher-* prefix"
|
||||
bar = (echo https://github.com/foo/theme-fisher-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fish-theme-* prefix"
|
||||
bar = (echo https://github.com/foo/fish-theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove theme-fish-* prefix"
|
||||
bar = (echo https://github.com/foo/theme-fish-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fish-pkg-* prefix"
|
||||
bar = (echo https://github.com/foo/fish-pkg-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove pkg-fish-* prefix"
|
||||
bar = (echo https://github.com/foo/pkg-fish-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisherman-* prefix"
|
||||
bar = (echo https://github.com/foo/fisherman-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisherman-theme-* prefix"
|
||||
bar = (echo https://github.com/foo/fisherman-theme-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove fisherman-plugin-* prefix"
|
||||
bar = (echo https://github.com/foo/fisherman-plugin-bar | __fisher_name)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Pass through other names"
|
||||
bar = (echo https://github.com/foo/bar | __fisher_name)
|
||||
end
|
||||
|
Loading…
Reference in New Issue