summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudia Pellegrino2018-12-13 16:34:09 +0100
committerClaudia Pellegrino2018-12-13 16:58:52 +0100
commit47953ee60cb3e038d87633d337184bf44261462b (patch)
tree404d6f5c769b65920664d72b882ce8f41653e762
parent28094eb9aa7ab086b4d16f2cc3a1e7c5c364320f (diff)
downloadaur-47953ee60cb3e038d87633d337184bf44261462b.tar.gz
Add support for `~/.bash_it/scripts` directory
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD18
-rw-r--r--bash-it-git.install11
-rwxr-xr-xinstall.sh.wrapper11
-rwxr-xr-xupgrade.sh.wrapper14
5 files changed, 42 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b0a6ccce5068..123e0fd098db 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = bash-it-git
pkgdesc = A community Bash framework
- pkgver = r2279.36345cb
+ pkgver = r2382.b973bb1
pkgrel = 1
url = https://github.com/Bash-it/bash-it
install = bash-it-git.install
@@ -34,6 +34,8 @@ pkgbase = bash-it-git
source = LICENSE
source = custom.lib.bash.shim
source = install.sh.wrapper
+ source = upgrade.sh.wrapper
+ sha512sums = SKIP
sha512sums = SKIP
sha512sums = SKIP
sha512sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 684d054baaa9..bc0797e892e5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
# PKGBUILD reference: https://wiki.archlinux.org/index.php/PKGBUILD
pkgname=bash-it-git
-pkgver=r2279.36345cb
+pkgver=r2382.b973bb1
pkgrel=1
pkgdesc='A community Bash framework'
arch=('any')
@@ -37,12 +37,14 @@ source=(
'LICENSE'
'custom.lib.bash.shim'
'install.sh.wrapper'
+ 'upgrade.sh.wrapper'
)
sha512sums=(
'SKIP'
'SKIP'
'SKIP'
'SKIP'
+ 'SKIP'
)
pkgver() {
@@ -65,7 +67,7 @@ package() {
cp -r --preserve=mode -t "${pkgdir}/usr/lib/${pkgname}" \
"${srcdir}/${pkgname}"/{bash_it,install,uninstall}.sh \
"${srcdir}/${pkgname}"/{aliases,completion,custom,lib} \
- "${srcdir}/${pkgname}"/{plugins,themes}
+ "${srcdir}/${pkgname}"/{plugins,scripts,themes}
# Copy warning shim to `lib/custom.bash`
cp --preserve=mode \
@@ -78,10 +80,12 @@ package() {
"${srcdir}/${pkgname}/install.sh" \
"${srcdir}/${pkgname}/template"
- # Copy wrapper for `install.sh`
- cp --preserve=mode \
- "${srcdir}/install.sh.wrapper" \
- "${pkgdir}/usr/share/${pkgname}/install.sh"
+ # Copy wrappers for `install.sh` and `upgrade.sh`
+ for event in install upgrade; do
+ cp --preserve=mode \
+ "${srcdir}/${event}.sh.wrapper" \
+ "${pkgdir}/usr/share/${pkgname}/${event}.sh"
+ done
cp --preserve=mode -t "${pkgdir}/usr/share/doc/${pkgname}" \
"${srcdir}/${pkgname}"/*.md
@@ -137,7 +141,7 @@ package() {
# Create symlinks to remaining files
ln -fs \
"/usr/lib/${pkgname}"/{bash_it,install,uninstall}.sh \
- "/usr/lib/${pkgname}"/{lib,themes} \
+ "/usr/lib/${pkgname}"/{lib,scripts,themes} \
"/usr/share/${pkgname}"/{.editorconfig,template} \
"/usr/share/doc/${pkgname}"/{CONTRIBUTING,DEVELOPMENT,README}.md \
"${_factorydir}/"
diff --git a/bash-it-git.install b/bash-it-git.install
index 79648ef950ff..804c425bf758 100644
--- a/bash-it-git.install
+++ b/bash-it-git.install
@@ -9,6 +9,17 @@ post_install() {
EOF
}
+post_upgrade() {
+ cat >&2 << 'EOF'
+
+ ## ##
+ ## To finish the upgrade for the logged-in user, ##
+ ## run: /usr/share/bash-it-git/upgrade.sh ##
+ ## ##
+
+EOF
+}
+
post_remove() {
cat >&2 << 'EOF'
diff --git a/install.sh.wrapper b/install.sh.wrapper
index edffc24120d8..f698ccf204c0 100755
--- a/install.sh.wrapper
+++ b/install.sh.wrapper
@@ -1,17 +1,12 @@
#!/usr/bin/env sh
set -e
-if [[ "$(whoami)" != "$(logname 2>/dev/null)" ]]; then
+if [ "$(whoami)" != "$(
+ logname 2>/dev/null || echo "${USER:-${LOGNAME}}")" ]
+then
echo >&2
echo >&2 'This command will install files into your' \
'home directory. It must be run *without* sudo.'
-
- if pacman -Q tmux >/dev/null 2>&1; then
- echo >&2 'Also, this installer does *not* support tmux sessions.'
- echo >&2 'Please detach from tmux; you can re-attach' \
- 'after this command has finished running.'
- fi
-
exit 1
fi
diff --git a/upgrade.sh.wrapper b/upgrade.sh.wrapper
new file mode 100755
index 000000000000..877fef5fb061
--- /dev/null
+++ b/upgrade.sh.wrapper
@@ -0,0 +1,14 @@
+#!/usr/bin/env sh
+set -e
+
+if [ "$(whoami)" != "$(
+ logname 2>/dev/null || echo "${USER:-${LOGNAME}}")" ]
+then
+ echo >&2
+ echo >&2 'This command will upgrade files in your' \
+ 'home directory. It must be run *without* sudo.'
+ exit 1
+fi
+
+cp -ruvP --preserve=mode,links -t ~/ \
+ "/usr/share/bash-it-git/home_factory/.bash_it"