diff options
-rwxr-xr-x | bin/pkgs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3,6 +3,7 @@ set -euo pipefail package_dir_base="$HOME/packages/" +nvchecker_config="${HOME}/.config/nvchecker/nvchecker.ini" repo="" package="" mode="" @@ -66,6 +67,13 @@ create_package() { -e '/#/d' \ -i "${pkgbuild}" fi + if [ ! -f "${nvchecker_config}" ]; then + mkdir -p "$(dirname "${nvchecker_config}")" + touch "${nvchecker_config}" + fi + if ! grep -q "\[$name\]" "${nvchecker_config}"; then + printf '\n[%s]\n\n' "${name}" >> "$nvchecker_config" + fi } remove_package() { @@ -182,8 +190,6 @@ if [ ${#@} -gt 0 ]; then new_package=1 ;; # TODO: introduce -m flag for moving package (e.g. community2extra, extra2community) - # TODO: introduce -n flag for creating new package (with PKGBUILD copied - # from default) r) check_mode_set mode="remove" |