<commit_before>function omf.remove_package
  for pkg in $argv
    if not omf.util_valid_package $pkg
      if test $pkg = "omf"
        echo (omf::err)"You can't remove `omf`"(omf::off) 1^&2
      else
        echo (omf::err)"$pkg is not a valid package/theme name"(omf::off) 1^&2
      end
      return $OMF_INVALID_ARG
    end

    if test -d $OMF_PATH/pkg/$pkg
      emit uninstall_$pkg
      rm -rf $OMF_PATH/pkg/$pkg
    else if test -d $OMF_PATH/themes/$pkg
      if test $pkg = (cat $OMF_CONFIG/theme)
        echo "" > $OMF_CONFIG/theme
      end
      rm -rf $OMF_PATH/themes/$pkg
    end
    if test $status -eq 0
      echo (omf::em)"$pkg succesfully removed."(omf::off)
    else
      echo (omf::err)"$pkg could not be found"(omf::off) 1^&2
    end
  end
  refresh
end<commit_msg>Fix #545: Remove custom packages and themes<commit_after>function omf.remove_package
  for pkg in $argv
    set -l remove_status 1

    if not omf.util_valid_package $pkg
      if test $pkg = "omf"
        echo (omf::err)"You can't remove `omf`"(omf::off) 1^&2
      else
        echo (omf::err)"$pkg is not a valid package/theme name"(omf::off) 1^&2
      end
      return $OMF_INVALID_ARG
    end

    for path in {$OMF_PATH,$OMF_CONFIG}/{pkg}/$pkg
      not test -d $path; and continue

      emit uninstall_$pkg
      rm -rf $path
      set remove_status $status
    end

    for path in {$OMF_PATH,$OMF_CONFIG}/{themes}/$pkg
      not test -d $path; and continue

      if test $pkg = (cat $OMF_CONFIG/theme)
        echo "" > $OMF_CONFIG/theme
      end

      rm -rf $path
      set remove_status $status
    end

    if test $remove_status -eq 0
      echo (omf::em)"$pkg succesfully removed."(omf::off)
    else
      echo (omf::err)"$pkg could not be found"(omf::off) 1^&2
    end
  end

  refresh
end
{'fraction_non_alphanumeric': 0.1192457016084304, 'fraction_numerical': 0.009983361064891847, 'mean_word_length': 2.4102079395085068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7570847', 'n_tokens_mistral': 679, 'n_tokens_neox': 645, 'n_words': 189}