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
61019c73
Commit
61019c73
authored
Sep 26, 2015
by
Bruno
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #48 from jeremiejig/fixomfdestroy
Fixes on omf destroy and omf.remove_package
parents
34686544
773f1010
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
36 deletions
+44
-36
pkg/omf/cli/omf.destroy.fish
pkg/omf/cli/omf.destroy.fish
+12
-3
pkg/omf/cli/omf.remove_package.fish
pkg/omf/cli/omf.remove_package.fish
+31
-32
pkg/omf/omf.fish
pkg/omf/omf.fish
+1
-1
No files found.
pkg/omf/cli/omf.destroy.fish
View file @
61019c73
function omf.destroy -d "Remove Oh My Fish"
function omf.destroy -d "Remove Oh My Fish"
echo (omf::dim)"Removing Oh My Fish..."(omf::off)
echo (omf::dim)"Removing Oh My Fish..."(omf::off)
omf.remove_package (basename $OMF_PATH/pkg/*) >/dev/null ^&1
for pkg in (basename $OMF_PATH/pkg/*)
omf.remove_package $pkg >/dev/null ^&1
end
set -l fish_config $XDG_CONFIG_HOME/fish
if test "$fish_config" = "/fish"
set fish_config $HOME/.config/fish
end
if test -e "$HOME/.config/fish/config.copy"
set -l localbackup (find $fish_config -regextype posix-extended -regex '^.*fish/config\.[[:digit:]]+\.copy$' |\
mv "$HOME/.config/fish/config".{copy,fish}
sort -r |head -1)
if test -n $localbackup
mv $localbackup "$fish_config/config.fish"
end
end
if test "$OMF_PATH" != "$HOME"
if test "$OMF_PATH" != "$HOME"
...
...
pkg/omf/cli/omf.remove_package.fish
View file @
61019c73
function omf.remove_package
function omf.remove_package
for pkg in $argv
set -l pkg $argv
set -l remove_status 1
set -l remove_status 1
if not omf.util_valid_package $pkg
if not omf.util_valid_package $pkg
if test $pkg = "omf" -o $pkg = "default"
if test $pkg = "omf" -o $pkg = "default"
echo (omf::err)"You can't remove `$pkg`"(omf::off) 1^&2
echo (omf::err)"You can't remove `$pkg`"(omf::off) 1^&2
else
else
echo (omf::err)"$pkg is not a valid package/theme name"(omf::off) 1^&2
echo (omf::err)"$pkg is not a valid package/theme name"(omf::off) 1^&2
end
return $OMF_INVALID_ARG
end
end
return $OMF_INVALID_ARG
end
for path in {$OMF_PATH,$OMF_CONFIG}/{pkg}/$pkg
for path in {$OMF_PATH,$OMF_CONFIG}/{pkg}/$pkg
not test -d $path; and continue
not test -d $path; and continue
emit uninstall_$pkg
emit uninstall_$pkg
omf.bundle.remove "package" $pkg
omf.bundle.remove "package" $pkg
rm -rf $path
rm -rf $path
set remove_status $status
set remove_status $status
end
end
for path in {$OMF_PATH,$OMF_CONFIG}/{themes}/$pkg
for path in {$OMF_PATH,$OMF_CONFIG}/{themes}/$pkg
not test -d $path; and continue
not test -d $path; and continue
if test $pkg = (cat $OMF_CONFIG/theme)
if test $pkg = (cat $OMF_CONFIG/theme)
echo default > $OMF_CONFIG/theme
echo default > $OMF_CONFIG/theme
end
end
omf.bundle.remove "theme" $pkg
omf.bundle.remove "theme" $pkg
rm -rf $path
rm -rf $path
set remove_status $status
set remove_status $status
end
end
if test $remove_status -eq 0
if test $remove_status -eq 0
echo (omf::em)"$pkg successfully removed."(omf::off)
echo (omf::em)"$pkg successfully removed."(omf::off)
refresh
else
else
echo (omf::err)"$pkg could not be found"(omf::off) 1^&2
echo (omf::err)"$pkg could not be found"(omf::off) 1^&2
end
end
end
return $remove_status
end
end
pkg/omf/omf.fish
View file @
61019c73
...
@@ -120,7 +120,7 @@ function omf -d "Oh My Fish"
...
@@ -120,7 +120,7 @@ function omf -d "Oh My Fish"
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" <[package|theme] name>" 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" <[package|theme] name>" 1^&2
return $OMF_INVALID_ARG
return $OMF_INVALID_ARG
end
end
omf.remove_package $argv[2
..-1]
omf.remove_package $argv[2
] ; and refresh
case "u" "up" "upd" "update"
case "u" "up" "upd" "update"
pushd $OMF_PATH
pushd $OMF_PATH
...
...
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