diff options
author | David Runge <dave@sleepmap.de> | 2019-05-05 21:34:53 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2019-05-05 21:34:53 +0200 |
commit | b5ada7f15fe83fbf80642ed18f1c94a38b6a885c (patch) | |
tree | dca20c5f4fa3945505080fa4b16dadb175c3ef67 /bin/pkgs | |
parent | 0e7088dff32643d7ba6814c4a56621b5bc249a6e (diff) | |
download | dotfiles-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-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" |