From 4248fb1ffefcb2b79516704fca39c8c86f9fac01 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 28 Sep 2022 22:14:24 -0700 Subject: [PATCH] Don't print version number when sourcing version.sh --- PKGBUILD | 24 ++++++++++-------------- bash/version.sh | 4 +++- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 8dbf71b..2514db4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,37 +5,33 @@ pkgrel=2 pkgdesc="Various scripts for performing file-related operations such as editing and deleting." arch=(any) license=(GPL3) -#depends=(bash fd fzf mlocate python python-termcolor) -depends=(bash fd fzf) +depends=(bash fd fzf mlocate python python-termcolor) makedepends=(git) -#makedepends=(git python-setuptools python-sphinx) -#checkdepends=(python-hypothesis python-pytest) +makedepends=(git python-setuptools python-sphinx) +checkdepends=(python-hypothesis python-pytest) source=("${pkgname}::git+file:///home/etorres/Projects/file-scripts") install=$pkgname.install sha256sums=('SKIP') pkgver() { cd "${srcdir}/${pkgname}/bash" - bash version.sh + bash version.sh --print } package() { - cd "${srcdir}/${pkgname}/bash" + cd "${srcdir}/${pkgname}" - for script in bin/*; do + for script in bash/bin/*; do install -Dm755 "$script" "$pkgdir/usr/bin/$(basename -s '.sh' "$script")" done - for libfile in *.sh; do - install -Dm644 "$libfile" "$pkgdir/usr/share/file-scripts/${libfile##*/}" + for libfile in bash/*.sh; do + install -Dm644 "$libfile" "$pkgdir/usr/share/file-scripts/$(basename "$libfile")" done - #python setup.py build - #python setup.py install --root="$pkgdir/" --optimize=1 - # Install zsh completions - for completion in zsh; do - install -m644 "${completion}" "${pkgdir}/usr/share/zsh/site-functions/${plugin##*.}" + for completion in zsh/*; do + install -Dm644 "${completion}" "${pkgdir}/usr/share/zsh/site-functions/$(basename "$completion")" done } diff --git a/bash/version.sh b/bash/version.sh index 76c85bf..ab5af11 100644 --- a/bash/version.sh +++ b/bash/version.sh @@ -4,4 +4,6 @@ MAJOR_VERSION=1 MINOR_VERSION=1 PATCH_VERSION=4 -echo "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" +if [[ "$1" == '--print' ]]; then + echo "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" +fi