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
0eeacf06
Commit
0eeacf06
authored
May 31, 2022
by
Pablo Santiago Blum de Aguiar
Committed by
Pablo Santiago Blum de Aguiar
May 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omf.packages.name: Fix regex by escaping a dot
Fix #901
parent
dc9d2c32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletion
+78
-1
pkg/omf/functions/packages/omf.packages.name.fish
pkg/omf/functions/packages/omf.packages.name.fish
+1
-1
pkg/omf/spec/omf_packages_spec.fish
pkg/omf/spec/omf_packages_spec.fish
+77
-0
No files found.
pkg/omf/functions/packages/omf.packages.name.fish
View file @
0eeacf06
function omf.packages.name -a name_or_url
command basename $name_or_url | sed -E 's/^(omf-)?((plugin|pkg|theme)-)?//;s/.git$//'
command basename $name_or_url | sed -E 's/^(omf-)?((plugin|pkg|theme)-)?//;s/
\\
.git$//'
end
pkg/omf/spec/omf_packages_spec.fish
0 → 100644
View file @
0eeacf06
function describe_omf_packages_tests
function before_all
set -gx CI WORKAROUND
end
function it_can_extract_name_from_name
set -l output (omf.packages.name foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_of_a_plugin_package
set -l output (omf.packages.name plugin-foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_of_a_theme_package
set -l output (omf.packages.name theme-foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_name_ended_in_dot_git
set -l output (omf.packages.name foo.git)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_name_with_dot
set -l output (omf.packages.name foo.bar)
assert 0 = $status
assert "foo.bar" = "$output"
end
function it_can_extract_name_from_name_ended_in_git
set -l output (omf.packages.name foobargit)
assert 0 = $status
assert "foobargit" = "$output"
end
function it_can_extract_name_from_url
set -l output (omf.packages.name http://github.com/user/foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_url_of_a_plugin_package
set -l output (omf.packages.name http://github.com/user/plugin-foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_url_of_a_theme_package
set -l output (omf.packages.name http://github.com/user/theme-foo)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_url_ended_in_dot_git
set -l output (omf.packages.name http://github.com/user/foo.git)
assert 0 = $status
assert "foo" = "$output"
end
function it_can_extract_name_from_url_with_dot
set -l output (omf.packages.name http://github.com/user/foo.bar)
assert 0 = $status
assert "foo.bar" = "$output"
end
function it_can_extract_name_from_url_ended_in_git
set -l output (omf.packages.name http://github.com/user/foobargit)
assert 0 = $status
assert "foobargit" = "$output"
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