aboutsummaryrefslogtreecommitdiffstats
path: root/bin/pkgs
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-05-05 21:34:53 +0200
committerDavid Runge <dave@sleepmap.de>2019-05-05 21:34:53 +0200
commitb5ada7f15fe83fbf80642ed18f1c94a38b6a885c (patch)
treedca20c5f4fa3945505080fa4b16dadb175c3ef67 /bin/pkgs
parent0e7088dff32643d7ba6814c4a56621b5bc249a6e (diff)
downloaddotfiles-b5ada7f15fe83fbf80642ed18f1c94a38b6a885c.tar.gz
dotfiles-b5ada7f15fe83fbf80642ed18f1c94a38b6a885c.tar.bz2
dotfiles-b5ada7f15fe83fbf80642ed18f1c94a38b6a885c.tar.xz
dotfiles-b5ada7f15fe83fbf80642ed18f1c94a38b6a885c.zip
bin/pkgs: Adding support for adding a dummy entry to a default nvchecker.ini (will be created if not existing).
Diffstat (limited to 'bin/pkgs')
-rwxr-xr-xbin/pkgs10
1 files changed, 8 insertions, 2 deletions
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"