From b5ada7f15fe83fbf80642ed18f1c94a38b6a885c Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 5 May 2019 21:34:53 +0200 Subject: bin/pkgs: Adding support for adding a dummy entry to a default nvchecker.ini (will be created if not existing). --- bin/pkgs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/pkgs b/bin/pkgs index 3dedbc1..8d0c34e 100755 --- a/bin/pkgs +++ b/bin/pkgs @@ -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" -- cgit v1.2.3-70-g09d2