mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-23 11:21:45 +08:00
commit
436e0306df
|
@ -16,7 +16,7 @@ function require -a name
|
||||||
and return 0
|
and return 0
|
||||||
|
|
||||||
for path in {$OMF_PATH,$OMF_CONFIG}/pkg/$name
|
for path in {$OMF_PATH,$OMF_CONFIG}/pkg/$name
|
||||||
if autoload $path $path/completions
|
if autoload $path $path/functions $path/completions
|
||||||
|
|
||||||
source $path/init.fish ^/dev/null;
|
source $path/init.fish ^/dev/null;
|
||||||
or source $path/$name.fish ^/dev/null;
|
or source $path/$name.fish ^/dev/null;
|
||||||
|
|
|
@ -15,7 +15,7 @@ function omf.remove_package
|
||||||
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
|
source $path/uninstall.fish; and emit uninstall_$pkg
|
||||||
omf.bundle.remove "package" $pkg
|
omf.bundle.remove "package" $pkg
|
||||||
|
|
||||||
rm -rf $path
|
rm -rf $path
|
||||||
|
|
10
pkg/omf/templates/pkg/functions/{{NAME}}.fish
Normal file
10
pkg/omf/templates/pkg/functions/{{NAME}}.fish
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# SYNOPSIS
|
||||||
|
# {{NAME}} [options]
|
||||||
|
#
|
||||||
|
# USAGE
|
||||||
|
# Options
|
||||||
|
#
|
||||||
|
|
||||||
|
function {{NAME}} -d "My package"
|
||||||
|
end
|
||||||
|
|
3
pkg/omf/templates/pkg/init.fish
Normal file
3
pkg/omf/templates/pkg/init.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function init -a path --on-event init_{{NAME}}
|
||||||
|
end
|
||||||
|
|
3
pkg/omf/templates/pkg/uninstall.fish
Normal file
3
pkg/omf/templates/pkg/uninstall.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function uninstall --on-event uninstall_{{NAME}}
|
||||||
|
end
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# SYNOPSIS
|
|
||||||
# {{NAME}} [options]
|
|
||||||
#
|
|
||||||
# USAGE
|
|
||||||
# Options
|
|
||||||
#
|
|
||||||
|
|
||||||
function init -a path --on-event init_{{NAME}}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function {{NAME}} -d "My package"
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function uninstall --on-event uninstall_{{NAME}}
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user