diff --git a/pkg/omf/cli/omf.bundle.add.fish b/pkg/omf/cli/omf.bundle.add.fish index b8df2af..b1693c6 100644 --- a/pkg/omf/cli/omf.bundle.add.fish +++ b/pkg/omf/cli/omf.bundle.add.fish @@ -10,6 +10,8 @@ function omf.bundle.add -a type name_or_url else echo $record > $bundle end + + sort -u $bundle -o $bundle end function __omf.write_theme diff --git a/pkg/omf/cli/omf.bundle.install.fish b/pkg/omf/cli/omf.bundle.install.fish index 1f5c867..054d7b4 100644 --- a/pkg/omf/cli/omf.bundle.install.fish +++ b/pkg/omf/cli/omf.bundle.install.fish @@ -1,10 +1,12 @@ function omf.bundle.install + set bundle $OMF_CONFIG/bundle - if test -f $OMF_CONFIG/bundle + if test -f $bundle set packages (omf.list_local_packages) set themes (omf.list_installed_themes) + set bundle_contents (cat $bundle | sort -u) - for record in (cat $OMF_CONFIG/bundle | uniq) + for record in $bundle_contents set type (echo $record | cut -d' ' -f1) set name_or_url (echo $record | cut -d' ' -f2-) set name (basename $name_or_url | sed 's/\.git//;s/^pkg-//;s/^plugin-//;s/^theme-//') @@ -20,8 +22,9 @@ function omf.bundle.install omf.install --theme $name end end - end + + sort -u $bundle -o $bundle end return 0 diff --git a/pkg/omf/cli/omf.bundle.remove.fish b/pkg/omf/cli/omf.bundle.remove.fish index 329bdfc..1006238 100644 --- a/pkg/omf/cli/omf.bundle.remove.fish +++ b/pkg/omf/cli/omf.bundle.remove.fish @@ -4,7 +4,7 @@ function omf.bundle.remove if test -f $bundle set type $argv[1] set name $argv[2] - set bundle_contents (cat $bundle | uniq) + set bundle_contents (cat $bundle | sort -u) rm -f $bundle @@ -17,7 +17,8 @@ function omf.bundle.remove if not test "$type" = "$record_type" -a "$name" = "$record_basename" echo "$record_type $record_name" >> $bundle end - end end + + return 0 end