From 8a9976c86d89d97c9022a4c0733e189b7d67baa8 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Fri, 15 Apr 2022 21:50:55 -0700 Subject: [PATCH] Add install script to package --- PKGBUILD | 3 ++- file-scripts.install | 54 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 file-scripts.install diff --git a/PKGBUILD b/PKGBUILD index 320f60c..b41bd51 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Eric Torres pkgname=file-scripts pkgver=1.1.1 -pkgrel=1 +pkgrel=2 pkgdesc="Various scripts for performing file-related operations such as editing and deleting." arch=(any) license=(GPL3) @@ -9,6 +9,7 @@ depends=(fd fzf mlocate python python-termcolor) makedepends=(git python-setuptools python-sphinx) checkdepends=(python-hypothesis python-pytest) source=("${pkgname}-${pkgver}::git+file:///home/etorres/Projects/file-scripts") +install=$pkgname.install sha256sums=('SKIP') pkgver() { diff --git a/file-scripts.install b/file-scripts.install new file mode 100644 index 0000000..905f83d --- /dev/null +++ b/file-scripts.install @@ -0,0 +1,54 @@ +## arg 1: the new package version +#pre_install() { + # do something here +#} + +post_install() { +cat << EOF +To bind a key to run fedit: + +Add the following lines to your shell config file: + +_run_fedit() { + fedit && zle reset-prompt +} + +_run_etcedit() { + fedit --etc && zle reset-prompt +} + +zle -N _run_fedit +bindkey -M viins '^o' _run_fedit + +zle -N _run_etcedit +bindkey -M viins '^e' _run_etcedit + +EOF +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +#post_upgrade() { + # do something here +#} + +# arg 1: the old package version +pre_remove() { +cat << EOF +Remember to remove any lines invoking any of these scripts from your shell config files +EOF +} + +## arg 1: the old package version +#post_remove() { + # do something here +#} +# +# +