Remove pkg-/theme- from folder name

When installing packages (plugins) or themes using a URL, we should
strip the plugin-/pkg-/theme- from the repository name if it exists.
This commit is contained in:
Bruno Pinto 2015-09-03 19:49:34 +01:00
parent e9472b4e3f
commit 905f6afa73

View File

@ -36,7 +36,7 @@ function omf.install -a type_flag name_or_url
if test -e $OMF_PATH/db/$parent_path/$name_or_url
set target $parent_path/$name_or_url
else
set -l local_name (basename $name_or_url)
set -l local_name (basename $name_or_url | sed "s/^pkg-//;s/^plugin-//;s/^theme-//")
if test -e $OMF_PATH/$parent_path/$local_name
echo (omf::err)"Error: $local_name $install_type already installed."(omf::off) 1^&2
else